Merge pull request #120 from JasonLong0/dev #50
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 Package to npmjs | |
| on: | |
| push: | |
| branches: ['master', 'main'] | |
| paths: | |
| - src/npm/pkg.json | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5.0.0 | |
| - name: Setup Deno | |
| uses: denoland/setup-deno@v2.0.3 | |
| with: | |
| deno-version: v1.x | |
| # 使用 dnt(https://deno.land/x/dnt@0.38.0/mod.ts) 打包 | |
| - name: 构建成 npm 包 | |
| run: deno task build:npm | |
| # Setup .npmrc file to publish to npm | |
| - name: 发布到 npmjs | |
| uses: actions/setup-node@v4.4.0 | |
| with: | |
| node-version: '22.x' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: | | |
| cd npm_dist | |
| npm ci | |
| npm publish | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |