ci: 添加测试步骤并使用pnpm替换npm命令 #33
Workflow file for this run
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: Publish Npm Package | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: # 手动触发工作流 | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - run: rm -rf .npmrc | |
| - name: Install Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| registry-url: https://registry.npmjs.org/ | |
| - uses: pnpm/action-setup@v4 | |
| name: Install pnpm | |
| with: | |
| # version: 10 | |
| run_install: true | |
| - name: Run Test | |
| run: pnpm run test | |
| - name: Publish | |
| run: | | |
| pnpm run build | |
| npm publish |