name: Release → npmjs # Production publish. Runs on GITHUB ONLY, on a version tag (`v*`). Publishes the stable # package to npmjs via OIDC **Trusted Publishing** — no long-lived token. Requires a trusted # publisher configured on npmjs for this package (org Expressive-Tea, repo green-tea, # workflow release.yml). npm also attaches build provenance automatically. on: push: tags: ['v*'] jobs: publish-prod: if: ${{ github.server_url == 'https://github.com' }} runs-on: ubuntu-latest permissions: id-token: write # OIDC for Trusted Publishing (also enables provenance) contents: read steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '22' registry-url: 'https://registry.npmjs.org' - run: npm install -g npm@latest # npm >= 11.5.1 is required for OIDC trusted publishing - run: npm ci # `npm publish` runs prepublishOnly (lint + complexity + typecheck + test + build) first. # No NODE_AUTH_TOKEN — npm exchanges the OIDC id-token for a short-lived publish token. - run: npm publish --access public