Merge branch 'release' #3
This file contains hidden or 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: npm publish # 定义工作流名称 | |
| on: | |
| workflow_dispatch: # 允许手动触发工作流,默认是不开启的 | |
| push: # 当有代码推送到仓库时触发 | |
| branches: | |
| - main | |
| jobs: | |
| build: # 工作流程中的一个作业 | |
| runs-on: ubuntu-latest # 指定运行作业的虚拟环境 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: enable pnpm | |
| run: corepack enable | |
| - name: install Dependencies | |
| run: | | |
| ls -al | |
| pnpm i | |
| pnpm build | |
| npm publish | |
| - name: Publish to NPM | |
| run: npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |