6.1 KiB
6.1 KiB
Versioning Guide
Semantic Versioning
Charon follows Semantic Versioning 2.0.0:
- MAJOR.MINOR.PATCH (e.g.,
1.2.3)- MAJOR: Incompatible API changes
- MINOR: New functionality (backward compatible)
- PATCH: Bug fixes (backward compatible)
Pre-release Identifiers
alpha: Early development, unstablebeta: Feature complete, testing phaserc(release candidate): Final testing before release
Example: 0.1.0-alpha, 1.0.0-beta.1, 2.0.0-rc.2
Creating a Release
Automated Release Process
-
Update version in
.versionfile:echo "1.0.0" > .version -
Commit version bump:
git add .version git commit -m "chore: bump version to 1.0.0" -
Create and push tag:
git tag -a v1.0.0 -m "Release v1.0.0" git push origin v1.0.0 -
GitHub Actions automatically:
- Creates GitHub Release with changelog
- Builds multi-arch Docker images (amd64, arm64)
- Publishes to GitHub Container Registry with tags:
v1.0.0(exact version)1.0(minor version)1(major version)latest(for non-prerelease on main branch)
Container Image Tags
Available Tags
latest: Latest stable release (main branch)nightly: Latest nightly build (nightly branch, rebuilt daily at 02:00 UTC)nightly-YYYY-MM-DD: Date-specific nightly buildnightly-<sha>: Commit-specific nightly builddevelopment: Latest development build (development branch)v1.2.3: Specific version tag1.2: Latest patch for minor version1: Latest minor for major versionmain-<sha>: Commit-specific build from maindevelopment-<sha>: Commit-specific build from development
Usage Examples
# Use latest stable release
docker pull ghcr.io/wikid82/charon:latest
# Use specific version
docker pull ghcr.io/wikid82/charon:v1.0.0
# Use latest nightly build (automated daily at 02:00 UTC)
docker pull ghcr.io/wikid82/charon:nightly
# Use date-specific nightly build
docker pull ghcr.io/wikid82/charon:nightly-2026-01-13
# Use commit-specific nightly build
docker pull ghcr.io/wikid82/charon:nightly-abc123
# Use development builds (unstable, every commit)
docker pull ghcr.io/wikid82/charon:development
# Use specific commit from main
docker pull ghcr.io/wikid82/charon:main-abc123
Nightly Builds
Nightly builds provide a testing ground for features before they reach main:
- Automated: Built daily at 02:00 UTC from the
nightlybranch - Source: Auto-merged from
developmentbranch - Purpose: Pre-release testing and validation
- Stability: More stable than
development, less stable thanlatest
When to use nightly:
- Testing new features before stable release
- Validating bug fixes
- Contributing to pre-release testing
- Running in staging environments
When to avoid nightly:
- Production environments (use
latestinstead) - Critical infrastructure
- When maximum stability is required
Nightly Versioning Format
Version Precedence
Charon uses the following version hierarchy:
- Stable releases:
v1.2.3(highest precedence) - Nightly builds:
nightly-YYYY-MM-DDornightly-{sha} - Development builds:
developmentordevelopment-{sha}(lowest precedence)
Nightly Version Tags
Nightly builds use multiple tag formats:
nightly: Always points to the latest nightly build (floating tag)nightly-YYYY-MM-DD: Date-specific build (e.g.,nightly-2026-01-13)nightly-{sha}: Commit-specific build (e.g.,nightly-abc1234)
Tag characteristics:
| Tag Format | Immutable | Use Case |
|---|---|---|
nightly |
No | Latest nightly features |
nightly-2026-01-13 |
Yes | Reproducible date-based testing |
nightly-abc1234 |
Yes | Exact commit testing |
Version in API responses:
Nightly builds report their version in the health endpoint:
{
"version": "nightly-2026-01-13",
"git_commit": "abc1234567890def",
"build_date": "2026-01-13T02:00:00Z",
"branch": "nightly"
}
Version Information
Runtime Version Endpoint
curl http://localhost:8080/api/v1/health
Response includes:
{
"status": "ok",
"service": "charon",
"version": "1.0.0",
"git_commit": "abc1234567890def",
"build_date": "2025-11-17T12:34:56Z"
}
Container Image Labels
View version metadata:
docker inspect ghcr.io/wikid82/charon:latest \
--format='{{json .Config.Labels}}' | jq
Returns OCI-compliant labels:
org.opencontainers.image.versionorg.opencontainers.image.createdorg.opencontainers.image.revisionorg.opencontainers.image.source
Development Builds
Local builds default to version=dev:
docker build -t charon:dev .
Build with custom version:
docker build \
--build-arg VERSION=1.2.3 \
--build-arg BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \
--build-arg VCS_REF=$(git rev-parse HEAD) \
-t charon:1.2.3 .
Changelog Generation
The release workflow automatically generates changelogs from commit messages. Use conventional commit format:
feat:New featuresfix:Bug fixesdocs:Documentation changeschore:Maintenance tasksrefactor:Code refactoringtest:Test updatesci:CI/CD changes
Example:
git commit -m "feat: add TLS certificate management"
git commit -m "fix: correct proxy timeout handling"
CI Tag-based Releases (recommended)
- CI derives the release
Versionfrom the Git tag (e.g.,v1.2.3) and embeds this value into the backend binary via Go ldflags; frontend reads the version from the backend's API. This avoids automatic commits tomain. - The
.versionfile is optional. If present, use thescripts/check-version-match-tag.shscript or the included pre-commit hook to validate that.versionmatches the latest Git tag. - CI will still generate changelogs automatically using the release-drafter workflow and create GitHub Releases when tags are pushed.