Release process
Overview
A release is a two-step process:
scripts/release.mjs— bumps version, generates changelog, commits, tags, runs checks and buildscripts/publish.mjs— publishes to npm, pushes the tag, creates a GitHub Release
Both scripts default to dry-run. Pass --for-real to execute.
Prerequisites
- npm account with publish access to the
janissarypackage - Logged in locally (
npm whoamishould show your account) ghCLI installed and authenticated- On the
master/mainbranch with a clean working tree
Step 1: Prepare the release
node scripts/release.mjs patch # dry-run: 0.5.0 -> 0.5.1
node scripts/release.mjs minor # dry-run: 0.5.0 -> 0.6.0
node scripts/release.mjs major # dry-run: 0.5.0 -> 1.0.0
node scripts/release.mjs 0.6.0 # dry-run: explicit version
node scripts/release.mjs patch --for-real # executeThe release level (patch, minor, major) follows Semantic Versioning. You can also specify an explicit semver.
What it does:
- Validates the working tree is clean and you're on
master/main - Pulls latest from remote (
git pull --rebase) - Generates the changelog section from conventional commits since the last tag, categorized by type (Features, Bug Fixes, Documentation, Refactoring, Chores, Breaking Changes)
- Updates
CHANGELOG.mdwith the new version entry - Bumps the version in
package.json - Commits the version bump (
feat(package): bump version to X.Y.Z) - Tags the commit (
vX.Y.Z) - Runs typecheck, the full test suite, and build
After completion, it prints the command to run for step 2.
Step 2: Publish
node scripts/publish.mjs # dry-run
node scripts/publish.mjs --for-real # actually publishWhat it does:
- Verifies the tag exists locally (created in step 1)
- Publishes to npm
- Pushes the commit and tag to GitHub
- Creates a GitHub Release with auto-generated release notes
Full workflow
# 1. Prepare
git checkout master
git status # confirm clean
node scripts/release.mjs patch # dry-run to preview
node scripts/release.mjs patch --for-real
# 2. Publish
node scripts/publish.mjs --for-realChangelog
The changelog follows Keep a Changelog and is maintained automatically by the release script. Each version section is generated from conventional commits and categorized by type.
The initial CHANGELOG.md was seeded manually with a summary of pre-release development. All subsequent entries are produced by the release script.
Verifying
After publishing, install the package and check the version:
npm install -g janissary
janus --versionThe GitHub Release will be visible at https://github.com/thirtysixthspan/janissary/releases.