- You must have push access to the repository
git,gh,jq,node, andnpmmust be installed- Tags matching
v*are protected by GitHub tag protection rulesets - Releases are immutable once published (GitHub repository setting)
- npm trusted publishing must be configured for the package (see Repository Settings)
Run the release script from the repository root:
bin/release.sh <patch|minor|major>The script will:
- Verify prerequisites and that CI is green on
main - Show any open PRs targeting
mainand ask for confirmation - Bump the version in
package.jsonandpackage-lock.json - Create a release branch, commit, push, and open a PR
- Wait for the PR to be merged (poll every 10s)
- Tag the merge commit and push the tag
- Wait for the release workflow to complete, which will:
- Run the full test suite across Node.js 18, 20, 22, and latest
- Verify that
package.jsonversion matches the tag - Create a GitHub Release with auto-generated release notes
- Publish to npm via OIDC trusted publishing with provenance
- Print links to the GitHub Release and npm package
Release notes are auto-generated from merged PR titles by the release workflow. To ensure useful changelogs:
- Use clear, descriptive PR titles (e.g., "Add External ID field to Contact model")
- Prefix breaking changes with
BREAKING:so they stand out in release notes - After the release is created, review and edit the notes on the Releases page if needed
For pre-release versions, use a semver pre-release suffix:
git tag vX.Y.Z-rc1
git push origin vX.Y.Z-rc1These will be automatically marked as pre-releases on GitHub and published to npm under the next dist-tag (not latest).
- Immutable releases: Once a GitHub Release is published, its tag cannot be moved or deleted, and release assets cannot be modified
- Tag protection rulesets:
v*tags cannot be deleted or force-pushed
- Publishing uses OIDC trusted publishing — no long-lived npm tokens are stored in the repository. GitHub Actions authenticates directly with npm via short-lived OIDC tokens.
- Once a package version is published to npm, it cannot be republished with different contents
- npm records integrity hashes (SHA-512) in
package-lock.jsonfor all installed packages, ensuring reproducible and tamper-evident installs - Packages are published with provenance, linking each version to the specific GitHub Actions run that built it
- A compromised maintainer account cannot modify or delete existing releases
- No long-lived npm tokens exist that could be leaked or stolen
- Tags cannot be moved to point to different commits after publication
- The npm registry provides an independent immutability layer beyond GitHub
- npm provenance allows anyone to verify a package was built from this repository by GitHub Actions
These settings must be configured by a repository admin:
- Immutable Releases: Settings > General > Releases > Enable "Immutable releases"
- Tag Protection Ruleset: Settings > Rules > Rulesets > New ruleset targeting tags matching
v*with deletion, force-push, and update prevention - GitHub Actions Environment: Settings > Environments > New environment named
npm - npm Trusted Publishing: On npmjs.com, go to chartmogul-node access settings and configure a trusted publisher with: repository
chartmogul/chartmogul-node, workflowrelease.yml, environmentnpm