Publish to npm #3
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 to npm | |
| # Trusted publishing (OIDC) with provenance — no npm token needed. | |
| # Configure the trusted publisher on npm first: | |
| # npmjs.com → package/account settings → Trusted Publisher | |
| # Repository: KayhanB21/queue-economics Workflow: publish.yml | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| id-token: write # required for OIDC trusted publishing + provenance | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| registry-url: "https://registry.npmjs.org" | |
| # Trusted publishing requires npm >= 11.5.1. | |
| - name: Update npm | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Test | |
| run: bun test | |
| - name: Build | |
| run: bun run build | |
| - name: Publish (provenance via OIDC) | |
| run: npm publish --provenance --access public |