The release workflow uses npm Trusted Publishing (OIDC), not a long-lived npm token. The npm publish step runs with provenance and waits for approval through the GitHub npm environment.
- In npm package settings, add a Trusted Publisher for GitHub Actions:
- organization/user:
roddcode - repository:
exactly-once - workflow filename:
publish.yml - environment:
npm - allowed action:
npm publish(not only stage publish)
- organization/user:
- In GitHub, create the
npmenvironment and require reviewers. Restrict it to themainbranch. - Confirm the repository has no
NPM_TOKENsecret; the workflow needs onlyid-token: write.
npm requires a recent CLI for trusted publishing. The workflow uses Node 24 and installs npm@11.12.1 explicitly.
-
Confirm
mainis clean andpackage.jsonhas the release version. -
Confirm
CHANGELOG.mdhas the dated entry and the changes match the tag. -
Run:
pnpm install --frozen-lockfile pnpm db:up pnpm audit pnpm typecheck pnpm lint pnpm test pnpm test:db pnpm build pnpm smoke:mcp pnpm example:mcp-retry pnpm validate:package npm pack --dry-run -
Commit the release preparation and push
main. Wait for CI to pass. -
Create an annotated tag on that exact commit and push it:
git tag -a v0.3.1 -m "exactly-once 0.3.1" git push origin v0.3.1 -
Create the GitHub Release from
v0.3.1using theCHANGELOG.mdentry. -
Run the Publish workflow with version
0.3.1and approve thenpmenvironment. This is the only step that publishes. -
Verify the registry:
npm view exactly-once@0.3.1 version dist.integrity dist.attestations npm audit signatures
-
Install the published tarball in independent ESM and CommonJS consumers and verify both the core and
exactly-once/mcp.
- Do not publish from a local token or from an uncommitted working tree.
- Do not reuse a version after npm accepts it; publish a new patch instead.
- Do not publish if CI is red or the tag does not point to the release commit.