chore: 同步主干最新变更到 2.x (#1457)

* 新增 NPM 发布工作流

自动执行 npm publish

* 优化 NPM 自动发布工作流

* 优化 NPM 自动发布工作流

剔除 分支 commit 触发条件

* 优化 NPM 发布工作流

更改为 release 创建时触发
This commit is contained in:
贤心 2023-12-16 17:46:45 +08:00 committed by GitHub
parent 91ca6143ad
commit 6a7d364b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

18
.github/workflows/npm-publish.yml vendored Normal file
View File

@ -0,0 +1,18 @@
name: Publish to NPM
on:
release:
types: [created]
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}