优化 NPM 发布工作流

更改为 release 创建时触发
pull/1457/head
贤心 12 months ago committed by GitHub
parent 9afc6cfe78
commit c0b1aa6c27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,9 +1,8 @@
name: Publish to NPM name: Publish to NPM
on: on:
push: release:
tags: types: [created]
- 'v*'
jobs: jobs:
publish-npm: publish-npm:
@ -13,7 +12,7 @@ jobs:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 16 node-version: 16
registry-url: 'https://registry.npmjs.org' registry-url: https://registry.npmjs.org
- run: npm publish - run: npm publish
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Loading…
Cancel
Save