mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-12-04 21:36:06 +08:00
Update publish.yml
This commit is contained in:
1 parent
b9e2af29cf
commit
d0b68be7ab
1 file changed
+10
-18
@@ -1,27 +1,19 @@
|
||||
name: npm publish
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [created]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
publish:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
id-token: write # OIDC 必須
|
||||
|
||||
id-token: write # OIDC 必須
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
# Setup .npmrc file to publish to npm
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20.x'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- run: npm install
|
||||
|
||||
- run: npm publish --provenance --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '24' # trusted publishing 需要 >= 22.14
|
||||
# 不要設 registry-url:它會寫入 _authToken=${NODE_AUTH_TOKEN},空值會干擾 OIDC
|
||||
- run: npm install -g npm@latest
|
||||
- run: npm install
|
||||
- run: npm publish --access public # 不用 NODE_AUTH_TOKEN
|
||||
Reference in new issue
Block a user