Releasing¶
Releases are cut from a tag. .github/workflows/release.yml runs on tags v*.
Flow¶
- Update
versioninpackage.jsonand add a## [x.y.z] - datesection toCHANGELOG.md. - Merge to
master, then tag and push:git tag vx.y.z && git push origin vx.y.z. - The workflow runs, in order:
- The same checks as CI (build and
npm run coverageon ubuntu and macOS, Node 20 and 22). - A check that fails the run if
package.jsonversion differs from the tag. - Build, then
npm pack --dry-runto log the tarball contents. npm publishof the packed tarball with--provenance, through npm trusted publishing (GitHub OIDC, no token).gh release createfor the tag with notes from that version'sCHANGELOG.mdsection and the.tgzattached.
- The same checks as CI (build and
A tag with a prerelease suffix (for example v1.2.3-rc.1) publishes with --tag next and creates a GitHub prerelease.
The package name is read from package.json; nothing in the workflows hard-codes it.
One-time setup¶
- First publish. The package is
murmur-it(murmuron npm belongs to an unrelated package). npm attaches a trusted publisher only to a package that exists, so publish the first version by hand from a clean checkout of the tag:npm login,npm ci && npm run build,npm publish --access public. - Trusted publisher. On npmjs.com, open the package, then Settings, then Trusted Publisher, then GitHub Actions, and register: user
rennf93, repositorymurmur, workflow filenamerelease.yml, environment empty. - Repository variable. Set
MURMUR_TRUSTED_PUBLISHtotrueunder Settings, Secrets and variables, Actions, Variables. Until then a tag still gets its GitHub release (with the packed tarball attached); only the npm publish step is skipped. - GitHub Pages. The docs workflow publishes the
gh-pagesbranch. Under Settings, Pages, set the source to Deploy from a branch:gh-pages,/ (root).