Versioning and Releases
How Chatons determines version numbers and builds release artifacts.
Version Bump Script
scripts/version.js examines Git commit messages since the latest semver tag and determines the bump type.
How It Works
- Find the latest Git tag matching
v?X.Y.Z(sorted byversion:refname) - If no tag exists, start from
0.0.0 - Read all commit subjects since that tag (
git log TAG..HEAD --oneline --no-merges) - Parse each subject for conventional commit type
- Determine bump: major, minor, patch, or none
- Update
package.json > version - Print the new version to stdout
Commit Parsing Rules
The script recognizes these commit types:
| Type | Example |
|---|---|
feat | feat: add model picker to extensions |
fix | fix: prevent crash on empty model list |
docs | docs: update user guide |
style | style: format composer component |
refactor | refactor: simplify auth flow |
perf | perf: cache model list |
test | test: add settings validation tests |
chore | chore: update dependencies |
Bump Precedence
| Priority | Condition | Bump |
|---|---|---|
| 1 | Subject contains BREAKING CHANGE or ends with ! | major |
| 2 | At least one feat: commit | minor |
| 3 | At least one fix: commit | patch |
| 4 | No qualifying commit type | none |
What It Is Not
- Not a complete Conventional Commits parser (does not parse multi-line footers)
- Not a full
semantic-releaseimplementation BREAKING CHANGEdetection checks the subject line only, not the commit body
CI Workflow
.github/workflows/build-all-platforms.yml handles the release pipeline.
Jobs
-
Determine and Set Version
- Checks out with full history
- Runs
node scripts/version.js - Commits updated
package.jsonif version changed ([skip ci]) - Outputs version for downstream jobs
-
Build macOS ARM64 (and other platform jobs)
- Syncs
package.jsonto the computed version - Determines signing mode based on available secrets
- Builds renderer and Electron main process
- Runs Electron Builder
- Validates and signs artifacts (see Signing Guide)
- Syncs
Ignored Paths
Push and pull-request triggers ignore:
docs/**README.md**/*.md
Documentation-only changes do not trigger release builds.
Artifact Naming
Current Electron Builder configuration:
| Platform | Pattern | Example |
|---|---|---|
| macOS DMG | ${productName}-latest-${arch}.${ext} | Chatons-latest-arm64.dmg |
| Windows NSIS | ${productName}Setup-latest.${ext} | ChatonsSetup-latest.exe |
| Linux | ${productName}-latest.${ext} | Chatons-latest.AppImage |
Artifact filenames use latest and architecture, not the semver number. Do not assume semver appears in filenames.
Local Usage
# Print the computed version (or apply the bump)
node scripts/version.js
# Run version tests
npm run version:test
Test files:
scripts/test-version.jsscripts/test-version-logic.js
Manual Override
No dedicated release CLI for manual overrides. The fallback is editing package.json > version directly and committing.
Related
- Signing Guide -- macOS signing and notarization
- Developer Guide -- Overall architecture