chore: 更新 publish.yml,移除不必要的註解並簡化 Node 環境設置

This commit is contained in:
myw
2026-06-11 00:47:39 +08:00 Unverified
parent 4b02482723
commit 58015fe45b
+5 -6
View File
@@ -8,20 +8,19 @@ jobs:
build:
runs-on: ubuntu-latest
# 這是 Trusted Publishing 必須的權限
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4 # 建議升級至較新版本的 checkout
- uses: actions/checkout@v4
- uses: actions/setup-node@v4 # 建議升級至較新版本的 setup-node
# 移除 registry-url,單純使用 setup-node 準備 Node 環境
- uses: actions/setup-node@v4
with:
node-version: '20.x' # 建議換成你目前使用的 Node LTS 版本
registry-url: 'https://registry.npmjs.org'
node-version: '20.x'
- run: npm install
# 使用 --provenance 進行發布,OIDC 自動完成驗證,不再需要 env.NODE_AUTH_TOKEN
# OIDC 和 provenance 會自動向官方 Registry 要權限
- run: npm publish --provenance