Merge pull request #31 from gulihong/main #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish to npm | |
on: | |
push: | |
branches: main | |
jobs: | |
publish: | |
name: Publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone repository | |
uses: actions/checkout@v3 # 克隆代码 | |
- name: Install Node.js | |
uses: actions/setup-node@v3 # 安装 Node.js | |
with: | |
node-version: lts/* | |
- name: Build step | |
run: 'npm install' # 安装依赖并打包 | |
- name: Publish to npm | |
run: npm publish --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # 调用 github 填写的 NPM_TOKEN |