File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish SDK to NPM
2+
3+ on :
4+ workflow_dispatch :
5+ inputs :
6+ bump :
7+ description : ' Version bump type'
8+ required : true
9+ default : ' patch'
10+ type : choice
11+ options :
12+ - patch
13+ - minor
14+ - major
15+ push :
16+ tags :
17+ - ' sdk-v*'
18+
19+ jobs :
20+ publish :
21+ runs-on : ubuntu-latest
22+ defaults :
23+ run :
24+ working-directory : sdk
25+ steps :
26+ - name : Checkout
27+ uses : actions/checkout@v4
28+ with :
29+ token : ${{ secrets.GITHUB_TOKEN }}
30+
31+ - name : Setup Node.js
32+ uses : actions/setup-node@v4
33+ with :
34+ node-version : ' 20'
35+ registry-url : ' https://registry.npmjs.org'
36+ cache : ' npm'
37+ cache-dependency-path : sdk/package-lock.json
38+
39+ - name : Install dependencies
40+ run : npm ci
41+
42+ - name : Bump Version
43+ if : github.event_name == 'workflow_dispatch'
44+ run : |
45+ git config user.name "github-actions[bot]"
46+ git config user.email "github-actions[bot]@users.noreply.github.com"
47+ npm version ${{ github.event.inputs.bump }} -m "chore(sdk): bump version to %s"
48+ git push origin main --follow-tags
49+
50+ - name : Build
51+ run : npm run build
52+
53+ - name : Publish to NPM
54+ run : npm publish --access public
55+ env :
56+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments