66 - ' v*'
77
88permissions :
9+ contents : write # to create release
910 id-token : write # OpenID Connect token needed for provenance
10- contents : write # to create release (changesets/action)
11- pull-requests : write # to create pull request (changesets/action)
1211
1312jobs :
1413 publish :
1716 - name : Checkout code repository
1817 uses : actions/checkout@v4
1918 with :
20- # This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
19+ # This makes Actions fetch all Git history
2120 fetch-depth : 0
2221
2322 - name : Setup pnpm
3130 with :
3231 node-version : 22
3332 cache : ' pnpm'
33+ registry-url : ' https://registry.npmjs.org'
3434
3535 # Ensure npm 11.5.1 or later is installed
3636 - name : Update npm
@@ -45,12 +45,30 @@ jobs:
4545 - name : Build
4646 run : pnpm run build
4747
48- - name : Create and publish versions
49- uses : changesets/action@v1
48+ - name : Extract version from tag
49+ id : version
50+ run : echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
51+
52+ - name : Update package versions to tag version
53+ run : |
54+ VERSION="${{ steps.version.outputs.VERSION }}"
55+ echo "Updating all packages to version $VERSION"
56+
57+ # Update all package.json files in packages directory
58+ for pkg in packages/*/package.json; do
59+ echo "Updating $pkg to version $VERSION"
60+ jq --arg version "$VERSION" '.version = $version' "$pkg" > tmp.json && mv tmp.json "$pkg"
61+ done
62+
63+ - name : Create GitHub Release
64+ uses : softprops/action-gh-release@v1
5065 with :
51- version : pnpm changeset:version
52- publish : pnpm changeset:release
53- commit : ' chore: release packages '
54- title : ' chore: release packages '
66+ tag_name : ${{ github.ref_name }}
67+ name : Release ${{ steps.version.outputs.VERSION }}
68+ draft : false
69+ prerelease : false
5570 env :
5671 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
72+
73+ - name : Publish to npm
74+ run : pnpm publish -r --no-git-checks --tag latest
0 commit comments