@@ -2,34 +2,52 @@ name: Release
22
33on :
44 push :
5- branches :
6- - master
5+ branches : [master]
6+ workflow_dispatch : # For dev publishing
77
88concurrency : ${{ github.workflow }}-${{ github.ref }}
99
10+ permissions :
11+ id-token : write # Required for OIDC / trusted publishing
12+ contents : write # Required for changesets pushing commits
13+ pull-requests : write # Required for changesets creating PRs
14+
1015jobs :
1116 release :
1217 name : Release
1318 runs-on : ubuntu-latest
1419 steps :
1520 - name : Checkout Repo
16- uses : actions/checkout@v3
17-
18- - name : Setup Node.js 16
19- uses : actions/setup-node@v3
21+ uses : actions/checkout@v5
22+ - name : Enable Corepack
23+ run : corepack enable
24+ - name : Setup Node.js 20
25+ uses : actions/setup-node@v6
2026 with :
2127 node-version : 20
28+ cache : yarn
29+ - name : Update npm
30+ run : |
31+ npm install -g npm@latest
32+ npm --version
2233
2334 - name : Install Dependencies
24- run : yarn
35+ run : yarn install --frozen-lockfile
2536
2637 - name : Create Release Pull Request or Publish to npm
2738 id : changesets
2839 uses : changesets/action@v1
40+ if : ${{ github.event_name == 'push' }}
2941 with :
3042 # This expects you to have a script called release which does a build for your packages and calls changeset publish
3143 publish : yarn release
3244 version : yarn changeset version
3345 env :
3446 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
35- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
47+ - name : Dev publish
48+ if : ${{ github.event_name == 'workflow_dispatch' }}
49+ run : |
50+ yarn changeset version --no-git-tag --snapshot dev
51+ yarn changeset publish --tag dev
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments