Skip to content

Commit ca25cd9

Browse files
committed
add .github
1 parent 0a7cb44 commit ca25cd9

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: 发布 NPM 包
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # 匹配所有以v开头的tag
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-node@v4
14+
with:
15+
node-version: '18'
16+
registry-url: 'https://registry.npmjs.org'
17+
- name: 配置 NPM 认证
18+
run: npm config set //registry.npmjs.org/:_authToken ${{ secrets.NODE_AUTH_TOKEN }}
19+
- run: npm publish
20+
env:
21+
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

0 commit comments

Comments
 (0)