44 inputs :
55 version :
66 type : choice
7- description : ' Release Version (next, beta, alpha, latest) '
7+ description : ' Release Version'
88 required : true
99 default : ' next'
1010 options :
11- - next
12- - beta
13- - alpha
1411 - latest
12+ - next
1513 branch :
1614 description : ' Release Branch (confirm release branch)'
1715 required : true
1816 default : ' main'
1917
2018permissions :
21- # Needed for pushing git tags during release
22- contents : write
23- # Kept for npm provenance/OIDC if used
2419 id-token : write
2520
2621jobs :
3530 with :
3631 fetch-depth : 25
3732 ref : ${{ github.event.inputs.branch }}
38- # Use repo-scoped token so pushing tags always works
39- token : ${{ secrets.REPO_SCOPED_TOKEN }}
4033
4134 # Use corepack to install pnpm
4235 - name : Setup Pnpm
@@ -60,26 +53,24 @@ jobs:
6053 - name : Install deps
6154 run : pnpm install
6255
56+ - name : Generate preview version
57+ if : github.event.inputs.version == 'next'
58+ run : |
59+ npx changeset version --snapshot next
60+
6361 - name : Build and test Packages
6462 run : |
6563 git fetch origin main
6664 npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
6765 npx nx run-many --targets=build --projects=tag:type:metro
6866 ls -l packages/*/dist packages/*/package.json
6967
70- - uses : actions/github-script@v7
71- id : version_to_release
72- with :
73- result-encoding : string
74- script : |
75- const fs = require('fs');
76- const packageJson = JSON.parse(fs.readFileSync('./packages/runtime/package.json', 'utf8'));
77- return 'v' + packageJson.version;
78-
79- - name : Publish to npm
80- env :
81- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
68+ - name : Publish latest version
69+ if : github.event.inputs.version == 'latest'
8270 run : |
83- git tag ${{ steps.version_to_release.outputs.result }}
84- git push origin ${{ steps.version_to_release.outputs.result }}
8571 pnpm -r publish --tag ${{ github.event.inputs.version }} --publish-branch ${{ github.event.inputs.branch }}
72+
73+ - name : Publish preview version
74+ if : github.event.inputs.version == 'next'
75+ run : |
76+ pnpm -r publish --tag next --no-git-checks
0 commit comments