Skip to content

Commit 08e4175

Browse files
committed
add release script
1 parent a36ba42 commit 08e4175

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish on Release
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
with:
16+
ref: master
17+
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
registry-url: 'https://registry.npmjs.org'
22+
23+
- name: Get Release Tag
24+
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
25+
26+
- name: Set git user
27+
run: |
28+
git config user.name github-actions
29+
git config user.email github-actions@github.com
30+
31+
- name: Set version ${{ env.tag }}
32+
run: |
33+
npm version ${{ env.tag }}
34+
git push
35+
36+
- name: Publish
37+
run: npm publish --access public
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)