Add comprehensive release automation: **GitHub Actions Release Workflow:** - Triggers on version tags (v*.*.*) - Builds multi-platform Docker images (amd64, arm64) - Publishes to GitHub Container Registry (ghcr.io) - Creates GitHub Releases with auto-generated changelogs - Generates build provenance attestations for supply chain security - Semantic versioning with tag variants (v1.0.0, 1.0, 1) **cargo-release Configuration:** - Automated version bumping in Cargo.toml - Updates CHANGELOG.md with version and date - Syncs Helm chart versions (Chart.yaml) - Creates git tags and commits - Pushes to remote automatically - Enforces main branch releases **Release Documentation:** - RELEASE.md with complete release process guide - CHANGELOG.md following Keep a Changelog format - Updated README.md with deployment and release sections - Instructions for patch, minor, and major releases - Dry-run support for testing - Hotfix and rollback procedures **Usage:** To create a release, simply run: cargo install cargo-release cargo release minor --execute This will: 1. Bump version in all relevant files 2. Update changelog 3. Create git tag 4. Trigger Docker image build and publish 5. Create GitHub Release with notes Docker images will be available at: ghcr.io/[owner]/barycenter:v1.0.0 ghcr.io/[owner]/barycenter:1.0 ghcr.io/[owner]/barycenter:1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5.1 KiB
Release Process
This document describes how to create a new release of Barycenter.
Prerequisites
-
Install cargo-release:
cargo install cargo-release -
Ensure you're on the main branch with a clean working tree:
git checkout main git pull origin main git status # Should show clean working tree -
Verify all tests pass:
cargo nextest run cargo clippy -- -D warnings cargo fmt -- --check
Release Steps
1. Update CHANGELOG.md
Before releasing, update the CHANGELOG.md:
- Move all changes from
[Unreleased]to a new version section - Add the release date
- Ensure all changes are categorized (Added, Changed, Deprecated, Removed, Fixed, Security)
Example:
## [Unreleased]
## [0.2.0] - 2025-12-01
### Added
- New feature X
- New feature Y
### Fixed
- Bug fix Z
2. Run cargo-release
cargo-release will:
- Bump the version in
Cargo.toml - Update the Helm chart versions
- Create a git commit
- Create a git tag
- Push to GitHub
Dry run first (recommended):
# Patch version bump (0.1.0 -> 0.1.1)
cargo release patch --dry-run
# Minor version bump (0.1.0 -> 0.2.0)
cargo release minor --dry-run
# Major version bump (0.1.0 -> 1.0.0)
cargo release major --dry-run
# Specific version
cargo release 1.0.0 --dry-run
Execute the release:
# Patch release
cargo release patch --execute
# Minor release
cargo release minor --execute
# Major release
cargo release major --execute
# Specific version
cargo release 1.0.0 --execute
3. Automated Release Process
Once the tag is pushed, GitHub Actions will automatically:
-
Build Docker images for multiple platforms:
- linux/amd64
- linux/arm64
-
Push images to GitHub Container Registry with tags:
ghcr.io/[owner]/barycenter:v1.0.0(full version)ghcr.io/[owner]/barycenter:1.0(major.minor)ghcr.io/[owner]/barycenter:1(major)ghcr.io/[owner]/barycenter:main-<sha>(commit SHA)
-
Create a GitHub Release with:
- Auto-generated changelog
- Docker pull instructions
- Links to documentation
-
Generate attestations for supply chain security
4. Verify the Release
After the release workflow completes:
-
Check GitHub Releases:
- Visit https://github.com/[owner]/barycenter/releases
- Verify the release notes are correct
- Check that all assets are present
-
Test the Docker image:
docker pull ghcr.io/[owner]/barycenter:v1.0.0 docker run --rm ghcr.io/[owner]/barycenter:v1.0.0 --version -
Test the Helm chart:
helm install barycenter ./deploy/helm/barycenter \ --dry-run \ --namespace barycenter-test
Versioning Strategy
We follow Semantic Versioning:
- MAJOR version (1.0.0 → 2.0.0): Incompatible API changes
- MINOR version (1.0.0 → 1.1.0): Backwards-compatible new features
- PATCH version (1.0.0 → 1.0.1): Backwards-compatible bug fixes
Pre-releases
For alpha, beta, or release candidates:
cargo release 1.0.0-alpha.1 --execute
cargo release 1.0.0-beta.1 --execute
cargo release 1.0.0-rc.1 --execute
Pre-release images are automatically marked as "pre-release" in GitHub.
Hotfix Releases
For urgent fixes:
-
Create a hotfix branch from the release tag:
git checkout -b hotfix/v1.0.1 v1.0.0 -
Make the fix and commit:
git add . git commit -m "fix: critical security issue" -
Run cargo-release:
cargo release patch --execute -
Merge back to main:
git checkout main git merge hotfix/v1.0.1 git push
Rollback
If you need to rollback a release:
-
Delete the tag locally and remotely:
git tag -d v1.0.0 git push origin :refs/tags/v1.0.0 -
Delete the GitHub Release:
- Go to Releases page
- Click Edit on the release
- Click Delete
-
Delete the container images:
- Go to Packages page
- Select the version
- Delete the package version
-
Revert the version bump commit:
git revert HEAD git push
Troubleshooting
cargo-release fails with dirty working tree
Ensure all changes are committed:
git status
git add .
git commit -m "chore: prepare for release"
GitHub Actions workflow fails
Check the workflow logs:
- Go to Actions tab
- Click on the failing workflow
- Review the error messages
- Fix the issue and re-run the workflow
Docker image build fails
Common issues:
- Platform-specific build errors: Check Dockerfile for platform compatibility
- Cache issues: Clear GitHub Actions cache and retry
- Dependency issues: Ensure Cargo.lock is up to date
Post-Release Tasks
After a successful release:
-
Announce the release:
- Update project documentation
- Post to social media/forums
- Notify users of breaking changes
-
Monitor for issues:
- Watch GitHub Issues
- Check container pull metrics
- Monitor error reports
-
Plan next release:
- Create milestone for next version
- Triage issues and features
- Update roadmap