Update workflow #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Changesets | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
changesets: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- id: changesets | |
uses: changesets/action@v1 | |
with: | |
publish: pnpm -r publish | |
createGithubReleases: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
#- name: DEBUG Emulate changesets publish action | |
# id: changesets | |
# run: | | |
# pnpm -r coverage | |
# data='[{"name": "@macropygia/vite-plugin-imagemin-cache", "version": "0.0.0"}, {"name": "@macropygia/vite-plugin-pug-static", "version": "0.0.0"}]' | |
# echo "::set-output name=publishedPackages::$data" | |
# echo "::set-output name=published::true" | |
# Waiting for pnpm support for changesets | |
# - name: DEBUG / Show changesets outputs | |
# run: | | |
# echo ${{ steps.changesets.outputs.published }} | |
# echo ${{ steps.changesets.outputs.publishedPackages }} | |
# - name: Convert publishedPackages to comma separated string using jq | |
# id: jq | |
# if: steps.changesets.outputs.published == 'true' | |
# run: | | |
# flags=`echo '${{ steps.changesets.outputs.publishedPackages }}' | jq '.[].name | split("/") | .[1]' | jq -s -j 'join(",")'` | |
# echo "::set-output name=codecovFlags::$flags" | |
# files=`echo '${{ steps.changesets.outputs.publishedPackages }}' | jq '.[].name | split("/") | .[1]' | jq -s -j 'map("packages/" + . + "/coverage/coverage-final.json") | join(",")'` | |
# echo "::set-output name=codecovFiles::$files" | |
# - name: Upload coverage to Codecov | |
# if: steps.changesets.outputs.published == 'true' | |
# uses: codecov/codecov-action@v3 | |
# with: | |
# flags: ${{ steps.jq.outputs.codecovFlags }} | |
# files: ${{ steps.jq.outputs.codecovFiles }} | |
# # verbose: true | |
# # dry_run: true |