name: Publish to npm on: release: types: [published] jobs: publish: runs-on: ubuntu-latest permissions: contents: read id-token: write steps: - uses: actions/checkout@v6 - name: Setup Bun uses: oven-sh/setup-bun@v2 with: bun-version: latest - name: Install dependencies run: bun install - name: Run tests run: bun test - name: Setup Node.js for npm publish uses: actions/setup-node@v4 with: # npm trusted publishing requires Node 22.14.0+. node-version: "24" registry-url: "https://registry.npmjs.org" - name: Publish to npm # With npm trusted publishing configured, npm exchanges the GitHub OIDC # token for a short-lived publish credential. No long-lived NPM token # or manual OTP is required. run: npm publish --access public