fix the release yml #6
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: Release (npm) | |
| on: | |
| push: | |
| tags: ['v*'] # v0.0.1, v1.2.3 | |
| workflow_dispatch: {} | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write # required for --provenance | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| # install & build (pnpm via npx so we don't need a pnpm setup step) | |
| - name: Install deps | |
| run: npx -y pnpm@9 install --frozen-lockfile | |
| - name: Build | |
| run: npx -y pnpm@9 build | |
| # sanity: confirm what we will publish | |
| - name: Show publish target | |
| run: node -e "const p=require('./dist/package.json'); console.log('Publishing:', p.name, p.version)" | |
| # ✅ publish from inside ./dist | |
| - name: Publish to npm | |
| working-directory: dist | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: npm publish --access public |