ci: drop npm self-upgrade that corrupted npm and broke publish #12
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" | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: "Only run npm publish --dry-run" | |
| type: boolean | |
| default: true | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| id-token: write # Required for OIDC | |
| contents: read | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| package-manager-cache: false | |
| registry-url: "https://registry.npmjs.org" | |
| # Trusted publishing needs npm CLI >= 11.5.1; Node 24 already bundles a | |
| # recent enough npm. Do NOT self-upgrade npm here: replacing a running | |
| # npm can corrupt its install (e.g. "Cannot find module 'sigstore'"). | |
| - run: | | |
| npm install --global pnpm@latest | |
| pnpm install --no-frozen-lockfile | |
| pnpm lint | |
| pnpm test | |
| pnpm build | |
| pnpm run test:dist | |
| - name: Dry-run npm publish | |
| if: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run }} | |
| run: npm publish --dry-run --access public | |
| # OIDC trusted publishing: no NODE_AUTH_TOKEN, provenance is generated automatically. | |
| - name: Publish to npm | |
| if: ${{ github.event_name == 'push' || inputs.dry_run == false }} | |
| run: npm publish --access public |