File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ release :
5+ types : [created]
6+
7+ jobs :
8+ npm :
9+ name : NPM
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - uses : actions/checkout@v4
14+ - name : Setup Node.js
15+ uses : actions/setup-node@v4
16+ with :
17+ node-version : 22
18+ registry-url : " https://registry.npmjs.org"
19+ - name : Install dependencies
20+ run : npm ci
21+ - name : Determine NPM tag
22+ id : npm-tag
23+ run : |
24+ version="${{ github.ref_name }}"
25+ major_version=$(echo "$version" | cut -d. -f1)
26+
27+ if [ "$major_version" = "13" ]; then
28+ echo "tag=legacy" >> $GITHUB_ENV
29+ else
30+ echo "tag=latest" >> $GITHUB_ENV
31+ fi
32+ - name : Publish to NPM
33+ run : npm publish --tag ${{ env.tag }}
34+ env :
35+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
You can’t perform that action at this time.
0 commit comments