File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed
Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish Beta to NPM
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ preid :
7+ description : ' Pre-release identifier (e.g. beta, alpha, rc)'
8+ required : false
9+ default : ' beta'
10+ type : string
11+
12+ permissions :
13+ contents : read
14+
15+ jobs :
16+ publish-beta :
17+ runs-on : ubuntu-latest
18+
19+ steps :
20+ - name : Checkout code
21+ uses : actions/checkout@v4
22+
23+ - name : Setup Node.js
24+ uses : actions/setup-node@v4
25+ with :
26+ node-version : ' 18'
27+ registry-url : ' https://registry.npmjs.org'
28+
29+ - name : Install dependencies
30+ run : npm ci
31+
32+ - name : Build package
33+ run : npm run build
34+
35+ - name : Set beta version
36+ run : |
37+ BASE_VERSION=$(node -p "require('./package.json').version")
38+ BETA_VERSION="${BASE_VERSION}-${{ github.event.inputs.preid }}.${{ github.run_number }}"
39+ npm version "$BETA_VERSION" --no-git-tag-version
40+ echo "Publishing version: $BETA_VERSION"
41+
42+ - name : Publish beta to npm
43+ run : npm publish --tag ${{ github.event.inputs.preid }} --access public
44+ env :
45+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments