ci(release): publish to npm with trusted publishing

Merged
MO
4d ago
+8-14

Removes the long-lived NPM_TOKEN from the release workflow. Both npm jobs now authenticate through npm trusted publishing (OIDC), the way the PyPI job already does.

Why
The v0.2.5 release reached crates.io and PyPI, but both npm jobs failed because the NPM_TOKEN secret could no longer publish. With trusted publishing there is no token to expire or rotate.

Changes

  • publish-npm and publish-npm-wasm: NODE_AUTH_TOKEN is gone from the publish and dry-run steps. Nothing else had to change: both jobs already run GitHub-hosted with id-token: write on Node 26 (npm 11.20), which is what trusted publishing needs.
  • NPM_CONFIG_PROVENANCE stays on the publish steps.
  • The comments now say the workflow filename is registered with npm as well as PyPI, and that both trusted publishing and provenance need a GitHub-hosted runner.

Needed on npm, outside this PR
Each of the nine packages needs a trusted publisher: GitHub Actions, firecrawl/anydoc, workflow release.yml, with npm publish allowed. The packages are @firecrawl/anydoc, @firecrawl/anydoc-wasm and the seven platform packages that napi prepublish publishes: -darwin-x64, -darwin-arm64, -linux-x64-gnu, -linux-x64-musl, -linux-arm64-gnu, -linux-arm64-musl and -win32-x64-msvc.

After merging
The NPM_TOKEN repository secret can be deleted.

Verification
The workflow parses, and a manual dispatch of this branch runs the whole pipeline in dry-run mode.

Open in Capy


Summary by cubic

Removes the long-lived NPM_TOKEN from the release workflow. Both npm jobs now authenticate through npm trusted publishing (OIDC), matching how the PyPI job already publishes. The v0.2.5 release reached crates.io and PyPI but both npm jobs failed because the NPM_TOKEN secret could no longer publish; trusted publishing removes the need to expire or rotate a token.

Drops NODE_AUTH_TOKEN from the publish and dry-run steps in publish-npm and publish-npm-wasm. Nothing else needed to change because both jobs already run GitHub-hosted with id-token: write. Comments now record that the workflow filename is registered with npm as well as PyPI, and that trusted publishing and provenance both require a GitHub-hosted runner.

Migration

  • Register a trusted publisher on npm for each of the nine packages — @firecrawl/anydoc, @firecrawl/anydoc-wasm, and the seven platform packages napi prepublish publishes (-darwin-x64, -darwin-arm64, -linux-x64-gnu, -linux-x64-musl, -linux-arm64-gnu, -linux-arm64-musl, -win32-x64-msvc) — for GitHub Actions, firecrawl/anydoc, workflow release.yml, with npm publish allowed.
  • After merging, delete the NPM_TOKEN repository secret.