From 95328ed493b4ce144df537159dd74c3e0295eb5d Mon Sep 17 00:00:00 2001 From: Denis Skripchenko Date: Sat, 14 Nov 2026 14:38:56 +0300 Subject: [PATCH] ci: release with changesets/action v2, which pushes tags and makes releases changesets/action@v1 looks for 'New tag:' lines in the publish output; the Changesets v3 CLI no longer prints them, so after publishing the action pushed no git tags and made no GitHub releases. v2 is built on Changesets v3 and pushes tags through the GitHub API; its inputs are renamed (publish -> publish-script) and the token is passed as github-token. Where a step tagged and released by hand in its place, that step goes. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 34 +++++----------------------------- 1 file changed, 5 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eacbb7..d39fc69 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,8 +17,6 @@ jobs: release: name: Release runs-on: ubuntu-latest - env: - HAS_NPM_TOKEN: ${{ secrets.NPM_TOKEN != '' }} steps: - uses: actions/checkout@v4 with: @@ -32,35 +30,13 @@ jobs: - run: pnpm install --frozen-lockfile # Without an npm token the job still opens version pull requests but # does not try to publish: a release is then published by hand. + # v2 reads the output of Changesets v3: v1 did not, so it pushed no tags + # and made no GitHub releases after publishing. - name: Create release pull request or publish - uses: changesets/action@v1 + uses: changesets/action@v2.1.2 with: - publish: ${{ secrets.NPM_TOKEN != '' && 'pnpm release' || '' }} + publish-script: ${{ secrets.NPM_TOKEN != '' && 'pnpm release' || '' }} + github-token: ${{ secrets.GITHUB_TOKEN }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NPM_CONFIG_PROVENANCE: true - # changesets/action does not read @changesets/cli 3's publish output, so it - # neither pushes the tag nor makes the GitHub release: done here for the - # version in package.json once npm has it and the tag is missing. - - name: Tag and GitHub release of the published version - if: env.HAS_NPM_TOKEN == 'true' - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - name=$(node -p "require('./package.json').name") - version=$(node -p "require('./package.json').version") - tag="v$version" - if git ls-remote --exit-code --tags origin "refs/tags/$tag" >/dev/null; then - echo "$tag is already tagged"; exit 0 - fi - # npm may take a minute to show what was just published. - for i in $(seq 1 12); do - npm view "$name@$version" version >/dev/null 2>&1 && found=1 && break - sleep 15 - done - if [ -z "$found" ]; then echo "$name@$version is not on npm"; exit 0; fi - awk -v v="$version" '$0 == "## " v { f = 1; next } /^## / { if (f) exit } f' CHANGELOG.md > "$RUNNER_TEMP/notes.md" - git rev-parse -q --verify "refs/tags/$tag" >/dev/null || git tag "$tag" - git push origin "refs/tags/$tag" - gh release create "$tag" --verify-tag --title "$tag" --notes-file "$RUNNER_TEMP/notes.md" --latest