Versioning and Release Process
This project uses an automated semantic versioning and tagging system integrated into the build process.
Overview
The versioning logic is handled by:
scripts/calculate_version.py: Python script that determines the next version based on git history.scripts/build-k8s.sh: Bash script that orchestrates the build, tagging, and Helm chart updates.
Branching Strategy
Main Branch (Releases)
When code is pushed to the main branch, the build script:
- Calculates the Next Version:
BREAKING CHANGEor!:in commit message triggers a MAJOR bump.feat:triggers a MINOR bump.fix:(or any other commit) triggers a PATCH bump.
- Updates Helm Charts:
- Updates
versionandappVersionincharts/specify7/Chart.yaml. - Updates
image.tagincharts/specify7/values.yaml.
- Updates
- Tags and Commits:
- Creates a git tag (e.g.,
v1.2.3). - Commits the updated YAML files with message
chore: release v1.2.3. - Pushes the tag and commit to the repository.
- Creates a git tag (e.g.,
- Builds Image:
- Triggers a Kaniko build in Kubernetes using the newly created tag as the version.
Feature Branches (Development)
When building from any other branch:
- Version: Uses the short git hash (e.g.,
a1b2c3d). - Updates Staging Config:
- Updates
image.tagincharts/specify7/staging.values.yamlto the short hash. - Note:
charts/specify7/values.yamlis NOT touched to keep the main release version stable.
- Updates
- Builds Image:
- Triggers a Kaniko build in Kubernetes using the short hash as the tag.
How to Release
Simply merge your changes to main. The build script (run via CI/CD or manually if configured) will handle the rest.
To manually trigger the build process:
./scripts/build-k8s.sh
Versioning Script Usage
You can run the version calculation directly to see what the next version would be:
python3 scripts/calculate_version.py
To use it to update files (advanced usage):
python3 scripts/calculate_version.py --update <version> <chart_file> <values_file> [staging_values_file]