Version Management System
Overview
CREATOR now uses a dynamic version management system that automatically handles version numbering based on the build channel (stable or nightly).
How It Works
Version Determination Priority
The version is determined using the following priority order:
CREATOR_VERSIONenvironment variable (highest priority)- Allows manual override for testing or special builds
- Example:
export CREATOR_VERSION=6.1.1-rc1
CREATOR_CHANNELenvironment variableCREATOR_CHANNEL=nightly: Generatesnightly-YYYYMMDDformatCREATOR_CHANNEL=stable: Uses version from package.json- Example:
export CREATOR_CHANNEL=nightly
Automatic inference from package.json
- If version contains prerelease identifiers (
beta,alpha,rc,nightly), treats as nightly - Otherwise treats as stable
- Current package.json version:
6.0.0-beta→ automatically treated as nightly
- If version contains prerelease identifiers (
Version Formats
Stable Channel
- Format:
major.minor.patch(e.g.,6.0.0,6.1.0,6.1.1) - Source:
package.jsonversion field - Used for: Official releases with version tags
Nightly Channel
- Format:
nightly-YYYYMMDD(e.g.,nightly-20251217) - Source: Auto-generated from current UTC date at build time
- Used for: Continuous integration builds from master branch
CI/CD Integration
GitHub Actions Configuration
The workflow has been updated to set the CREATOR_CHANNEL environment variable:
- name: Build cli binaries
env:
CREATOR_CHANNEL: nightly # Set to 'stable' for release builds
run: |
bun run-p build:cli:windows build:cli:mac-x64 ...
For Stable Releases
When creating a tagged release, remove or set CREATOR_CHANNEL=stable to use the package.json version:
- name: Build cli binaries
env:
CREATOR_CHANNEL: stable
run: |
bun run-p build:cli:windows build:cli:mac-x64 ...
Or simply don't set the variable if your package.json has a proper semantic version without prerelease identifiers.
Local Development
Testing Nightly Builds Locally
# Set nightly channel
export CREATOR_CHANNEL=nightly
# Build the CLI
bun run build:cli:native
# The binary will report version as nightly-YYYYMMDD
./creator-cli
Testing Stable Builds Locally
# Set stable channel
export CREATOR_CHANNEL=stable
# Build the CLI
bun run build:cli:native
# The binary will report version from package.json
./creator-cli
Override Version for Testing
# Directly set a specific version
export CREATOR_VERSION=6.0.0-test1
# Build the CLI
bun run build:cli:native
# The binary will report version as 6.0.0-test1
./creator-cli
Update Checker Behavior
The update checker automatically determines the appropriate channel:
- If current version matches
nightly-YYYYMMDDpattern → checks nightly channel - If current version contains prerelease identifiers → checks nightly channel
- Otherwise → checks stable channel
Nightly Updates
- Checks:
https://api.github.com/repos/creatorsim/creator-beta/releases/tags/nightly - Compares by date (YYYYMMDD)
- Shows update notification if a newer nightly build exists
Stable Updates
- Checks:
https://api.github.com/repos/creatorsim/creator/releases/latest - Compares by semantic version (major.minor.patch)
- Shows update notification if a newer stable version exists
Code Structure
Main Files
src/cli/version.mts: Version determination logicgetVersion(): Returns the current versionisNightlyBuild(): Determines if on nightly channelgenerateNightlyVersion(): Generates nightly version string
src/cli/update-checker.mts: Update checking logic- Detects channel from current version
- Fetches latest version from appropriate GitHub repo
- Compares versions and displays notifications
src/cli/creator-cli.mts: CLI entry point- Calls
getVersion()to get current version - Passes version to update checker
- Calls
src/cli/commands/info.mts: Info/about command- Displays current version from
getVersion()
- Displays current version from
Migration from Hardcoded Version
Before
// version was hardcoded in package.json as "6.0.0-beta"
checkForUpdates(packageJson.version);
After
// version is determined dynamically
import { getVersion } from "./version.mts";
const currentVersion = getVersion();
checkForUpdates(currentVersion);
Recommendations
For Nightly Builds
- Keep
CREATOR_CHANNEL=nightlyin your nightly workflow - The version will automatically be
nightly-YYYYMMDD - Users will see update notifications daily if they run nightly builds
For Stable Releases
- Update
package.jsonversion to proper semantic version (e.g.,6.0.0,6.1.0,6.1.1) - Remove prerelease identifiers from package.json version
- Set
CREATOR_CHANNEL=stableor leave unset - Create a git tag matching the version
- Trigger the release workflow
Version Bumping Strategy
// For stable releases - update package.json:
{
"version": "6.0.0" // No prerelease identifier
}
// For development/beta - keep prerelease:
{
"version": "6.1.1-beta" // Automatically treated as nightly
}
Testing the Implementation
# 1. Test version detection
deno run -A ./src/cli/creator-cli.mts --help
# 2. Test with different channels
CREATOR_CHANNEL=stable deno run -A ./src/cli/creator-cli.mts --help
CREATOR_CHANNEL=nightly deno run -A ./src/cli/creator-cli.mts --help
# 3. Test version override
CREATOR_VERSION=test-1.0.0 deno run -A ./src/cli/creator-cli.mts --help
# 4. Check update checker behavior
deno run -A ./src/cli/creator-cli.mts -a ./architecture/RISCV/RV32IMFD.yml -s ./tests/arch/riscv/correct/examples/test_riscv_example_001.s
Benefits
- Automatic nightly versioning: No manual version updates needed for nightly builds
- Clear channel separation: Users know if they're on stable or nightly
- Proper update notifications: Users on nightly see nightly updates, stable users see stable updates
- Flexible override: Can test with specific versions using environment variables
- CI/CD ready: Simple environment variable configuration in workflows