Skip to content

Commit 7a991e5

Browse files
committed
ci: update npm publish workflow
1 parent 32b8799 commit 7a991e5

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
push:
66
tags:
77
- "v*"
8+
9+
permissions:
10+
id-token: write # Required for OIDC
11+
contents: read
12+
813
# 任务,定义个changelog 的任务
914
jobs:
1015
changelog:
@@ -56,11 +61,12 @@ jobs:
5661
# version: 8
5762
# 设置 Node
5863
- name: Setup Node
59-
uses: actions/setup-node@v3
64+
uses: actions/setup-node@v4
6065
with:
61-
node-version: 18
62-
cache: npm
66+
node-version: 20
6367
registry-url: https://registry.npmjs.org
68+
69+
- run: npm install -g npm@latest
6470
# 安装依赖
6571
- name: Install dependencies
6672
run: npm install
@@ -83,8 +89,4 @@ jobs:
8389
# run: pnpm run build
8490
# 发布npm 发布前执行了prepublishOnly
8591
- name: Publish npm
86-
run: npm publish --tag ${{ steps.determine_tag.outputs.tag }}
87-
env:
88-
# 这里需要几个 Token 变量
89-
# NPM_TOKEN 需要在 npm 网站生成
90-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
92+
run: npm publish --tag ${{ steps.determine_tag.outputs.tag }} --access public

0 commit comments

Comments
 (0)