1111
1212concurrency : ${{ github.workflow }}-${{ github.ref }}
1313
14+ env :
15+ NODE_VERSION : 22.x
16+
1417jobs :
1518 release :
1619 name : Release
@@ -26,22 +29,39 @@ jobs:
2629 - name : Setup pnpm with cache
2730 uses : ./.github/actions/setup-pnpm
2831 with :
29- node-version : ' 22.x'
30- registry-url : ' https://npm.pkg.github.com'
32+ node-version : ${{ env.NODE_VERSION }}
3133
3234 - name : Install Playwright Browsers
3335 run : pnpm exec playwright install
3436
3537 - name : Test
3638 run : pnpm test
3739
38- - name : Create release PR or publish to GitHub packages
40+ - uses : actions/create-github-app-token@v2
41+ id : app-token
42+ with :
43+ app-id : ${{ vars.APP_ID }}
44+ private-key : ${{ secrets.PRIVATE_KEY }}
45+
46+ - name : Create release PR
3947 id : changesets
4048 uses : changesets/action@v1
4149 with :
42- publish : pnpm release
43- commit : " ci(changesets): version packages"
50+ commit : " Version packages"
4451 commitMode : github-api
52+ env :
53+ GITHUB_TOKEN : ${{ steps.app-token.outputs.token }}
54+
55+ - name : Build the release
56+ if : steps.changesets.outputs.published == 'true'
57+ run : pnpm release
58+
59+ - name : Upload release asset
60+ if : steps.changesets.outputs.published == 'true'
61+ run : |
62+ set -e
63+ LATEST_TAG=$(gh release list --limit 1 --json tagName -q '.[0].tagName')
64+ gh release upload "$LATEST_TAG" dist/design-system.tgz
65+ echo "Uploaded $ASSET to the release $TAG"
4566 env :
4667 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
47- NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments