Releases are staged on npm by the Release workflow using npm trusted publishing, then approved by a maintainer. No npm token is needed. The workflow can only stage a release, so nothing goes live without a maintainer's 2FA approval.
- Run
npm version [patch/minor/major]to bump the version number inpackage.json. This creates a commit and a matching Git tag (e.g.v7.0.6). - Update
CHANGELOG.mdby creating a section for the new version, moving all unreleased changes to that section, and adding a link for the new section at the bottom. Amend these changes into the commit created bynpm version, then move the tag to the amended commit withgit tag -f vX.Y.Z. - Run
git pushto pushmasterto GitHub andgit push --tagsto push the tag. - Pushing the tag starts the Release workflow. It checks that the tag matches the version in
package.json, runsyarn ci, and runsnpm stage publish. Watch it under the repository's Actions tab. - Approve the staged version: on npmjs.com, open the package's Staged Packages tab, review it, and click Approve. Or run
npm stage listto find the stage ID,npm stage download <stage-id>to inspect the tarball, andnpm stage approve <stage-id>. Approving requires 2FA. The release isn't public until it's approved.
The trusted publisher is configured in the package's settings on npmjs.com. It must name:
- Organization or user:
tbroadley - Repository:
spellchecker-cli - Workflow filename:
release.yaml - Allowed actions:
npm stage publishonly. Leavenpm publishandnpm dist-tagturned off.
If the workflow file is renamed, update the npm setting to match, or publishing will fail.