This project uses a changelog-driven release workflow. The target version is always read from CHANGELOG.md — there is no version argument. Update the changelog first, then run the release script.
For the first public release, keep CHANGELOG.md and package.json at 0.1.0. The release script detects that v0.1.0 is not tagged or published yet and allows that initial publish before the later Shakapacker-backed 1.0.0.
- Actual release only:
npm whoamimust succeed - Actual release only:
gh auth statusmust succeed with write access - Clean git on main:
git statusmust be clean, branch must bemain
Update CHANGELOG.md with the target version header and entries.
Option A — Use Claude Code (recommended):
Run /update-changelog release to:
- Find merged PRs missing from the changelog
- Add entries under appropriate category headings
- Stamp the version header (e.g.,
## [v1.1.0] - 2026-03-20) - Commit, push, and open a PR
Review and merge the PR.
Option B — Manual:
- Move entries from
### [Unreleased]to a new## [vX.Y.Z] - YYYY-MM-DDheader - Update the
[unreleased]:compare link at the bottom - Add a new version compare link
- Commit and push to
main
# Recommended: dry run first
npm run release:dry-run
# Actual release
npm run releaseThe script will:
- Read the target version from the first
## [vX.Y.Z]header in CHANGELOG.md - Compare to
package.jsonand confirm one of three states:package.jsonalready matches the release version: proceed if that version is still unpublishedpackage.jsonis behind the changelog version: letrelease-itupdatepackage.jsonandpackage-lock.jsonpackage.jsonis ahead of the changelog version: stop with an error until the files agree- when the version is already updated, the script passes the same-version flags to
release-itso the first publish can still proceed
- Run pre-flight checks (clean git, main branch, tag doesn't exist, and auth checks for actual releases)
- Run
npm testandnpm run build - Show a summary and ask for confirmation
- Run
npx release-itto updatepackage.jsonwhen needed, commit, tag, and publish to npm - Create a GitHub release from the CHANGELOG section via
gh
- npm: https://www.npmjs.com/package/pack-config-diff
- GitHub releases: https://github.com/shakacode/pack-config-diff/releases
Use npm semver pre-release format in the CHANGELOG header:
## [v2.0.0-rc.1] - 2026-04-01The script auto-detects the pre-release suffix and publishes with --npm.tag=next instead of latest. Users install with:
npm install pack-config-diff@nextscripts/release.sh performs these steps:
- Reads version from
CHANGELOG.md(first## [vX.Y.Z]after[Unreleased]) - Compares the
CHANGELOG.mdversion topackage.jsonand either reuses it, bumps to it, or stops ifpackage.jsonis already ahead - Detects pre-release (version contains
-) and sets npm dist-tag accordingly - Checks npm publish state, retrying anonymously if local npm auth is broken
- Pre-flight checks: clean git, main branch, no existing tag, and npm/gh auth for actual releases
- Runs
npm test && npm run build(skippable with--skip-tests) - Shows summary and prompts for interactive confirmation
- Runs
npx release-it <version>with CLI flags (no config file, no devDependency) - Creates GitHub release via
gh release createwith notes from CHANGELOG section
Version already exists on npm: Choose a different version in CHANGELOG.md and re-run.
Dry run says npm auth is unavailable:
That is safe for npm run release:dry-run. Re-run npm login before npm run release.
Dry run says GitHub CLI auth is unavailable:
That is safe for npm run release:dry-run. Re-run gh auth login before npm run release.
npm publish failed after tag was created:
Delete the tag (git tag -d vX.Y.Z && git push origin :vX.Y.Z), fix the issue, and re-run.
GitHub release failed after npm publish:
Run manually: gh release create vX.Y.Z --title "vX.Y.Z" --notes "..."
Manual release fallback:
# Bump version
npm version X.Y.Z --no-git-tag-version
git add package.json package-lock.json
git commit -m "Release vX.Y.Z"
git tag vX.Y.Z
git push && git push --tags
# Publish
npm publish
# GitHub release
gh release create vX.Y.Z --title "vX.Y.Z" --notes "Release notes here"