Release Workflow
This document explains the release process for Driftless, including how to trigger releases manually or via version tags.
Table of Contents
Overview
Driftless uses a separate release workflow that is independent from the main CI pipeline. Releases can be triggered in two ways:
- Manually using GitHub Actions
workflow_dispatch(with customizable options) - Automatically by pushing a version tag matching the pattern
vX.Y.Z
Rationale
The release process is separated from the standard CI workflow for several important reasons:
1. Performance and Efficiency
- Release builds are time-consuming, especially when building binaries for multiple platforms
- Standard CI/CD checks (linting, testing, formatting) run frequently on every push and PR
- Separating releases keeps the main CI pipeline fast and responsive
- Developers get quick feedback on code quality without waiting for unnecessary release builds
2. Resource Optimization
- Release builds consume significant compute resources (cross-compilation, multi-platform builds)
- Not every merge to
mainrequires a release - Running release builds only when needed reduces GitHub Actions usage and costs
3. Clear Separation of Concerns
- CI pipeline focuses on validation: ensuring code quality, passing tests, and meeting standards
- Release pipeline focuses on distribution: building artifacts and creating GitHub releases
- This separation makes workflows easier to understand, maintain, and debug
4. Flexibility and Control
- Manual releases allow for intentional version bumps and controlled release schedules
- Tag-based releases enable GitOps-style workflows
- Draft and pre-release options provide staging mechanisms
Triggering a Release
Manual Release via workflow_dispatch
Manual releases provide the most control and are ideal for planned releases.
Step-by-Step Process
-
Navigate to GitHub Actions
- Go to your repository on GitHub
- Click on the “Actions” tab
- Select “Release” from the workflows list on the left
-
Trigger the Workflow
- Click “Run workflow” button
- Select the branch (typically
main)
-
Configure Release Options
The workflow provides several input options:
Input Description Required Default versionSpecific version to release (e.g., 0.2.0). Leave empty to auto-bump.No - bumpVersion bump type if no version specified ( patch,minor,major)No patchcreate_tagWhether to create and push a git tag No trueprereleaseMark the release as a pre-release No falsedraftCreate the release as a draft No falseExample Scenarios
Scenario 1: Patch Release (auto-bump)
- Leave
versionempty - Set
bumptopatch - Leave other options at defaults
- This will bump from
0.1.0→0.1.1
Scenario 2: Specific Version
- Set
versionto0.2.0 - Leave other options at defaults
- This will release exactly version
0.2.0
Scenario 3: Pre-release
- Set
versionto0.2.0-beta.1 - Set
prereleasetotrue - Set
drafttofalse - This creates a pre-release that’s visible but marked as unstable
Scenario 4: Draft Release
- Set
versionto1.0.0 - Set
drafttotrue - This creates a draft release that you can review and publish later
- Leave
-
Monitor Progress
- The workflow will appear in the Actions tab
- Click on the running workflow to see real-time logs
- The workflow consists of:
- Build jobs: Compile binaries for each supported platform
- Release job: Create GitHub release with artifacts
-
Verify the Release
- Once complete, navigate to the “Releases” page
- Verify the release version, notes, and artifacts
Automatic Release via Version Tags
Tag-based releases enable a GitOps workflow where pushing a version tag automatically triggers a release.
Tag Format
Tags must follow semantic versioning with a v prefix:
- Standard releases:
vX.Y.Z(e.g.,v0.1.0,v1.2.3) - Pre-releases:
vX.Y.Z-<label>(e.g.,v0.2.0-beta.1,v1.0.0-rc.2)
Where:
X= Major versionY= Minor versionZ= Patch version<label>= Optional pre-release identifier
Step-by-Step Process
-
Ensure Your Local Repository is Up-to-Date
git checkout main git pull origin main -
Update the Version in Cargo.toml (if needed)
# Edit Cargo.toml manually or use cargo-release sed -i 's/version = "0.1.0"/version = "0.2.0"/' Cargo.toml # Commit the change git add Cargo.toml git commit -m "chore: bump version to 0.2.0" git push origin main -
Create and Push the Tag
# Create an annotated tag git tag -a v0.2.0 -m "Release v0.2.0" # Push the tag to GitHub git push origin v0.2.0 -
Automatic Release
- Pushing the tag automatically triggers the release workflow
- GitHub Actions will build binaries and create a release
- The release will be published automatically (not a draft)
Alternative: Using cargo-release
For a more integrated approach, you can use cargo-release:
# Install cargo-release (if not already installed)
cargo install cargo-release
# Perform a patch release (0.1.0 → 0.1.1)
cargo release patch --execute
# Perform a minor release (0.1.0 → 0.2.0)
cargo release minor --execute
# Perform a major release (0.1.0 → 1.0.0)
cargo release major --execute
# Create a specific version
cargo release --execute 0.3.0
cargo-release will:
- Update the version in
Cargo.toml - Create a git commit
- Create and push a git tag
- This tag push will trigger the release workflow
Release Process Details
What Happens During a Release
-
Build Phase (runs in parallel)
- For each supported platform:
- Check out the code
- Set up the Rust toolchain for the target platform
- Build the release binary with optimizations
- Upload the binary as an artifact
- For each supported platform:
-
Release Phase (runs after all builds complete)
- Download all build artifacts
- Determine the release version
- Generate release notes from git history
- Create a GitHub release with:
- Version tag
- Release notes
- Binary artifacts for download
- Optional draft/pre-release flags
Generated Artifacts
For each supported platform, a binary artifact is created:
driftless-linux-amd64- Linux x86_64 (currently implemented)driftless-linux-arm64- Linux ARM64 (planned)driftless-macos-amd64- macOS Intel (planned)driftless-macos-arm64- macOS Apple Silicon (planned)driftless-windows-amd64.exe- Windows x86_64 (planned)driftless-windows-arm64.exe- Windows ARM64 (planned)
Release Notes
Release notes are automatically generated and include:
- Version number
- List of commits since the previous release
- Installation instructions for each platform
- Links to the binary artifacts
Platform Support
Currently Implemented
- ✅ Linux amd64 (x86_64-unknown-linux-gnu)
Planned (Ready to Enable with Additional Setup)
The workflow includes matrix entries for these platforms, but they require additional setup:
- ⏳ Linux arm64 (aarch64-unknown-linux-gnu) - Requires self-hosted runner or GitHub-hosted ubuntu-24.04-arm runner when available
- ⏳ macOS amd64 (x86_64-apple-darwin) - Available on
macos-13GitHub-hosted runner - ⏳ macOS arm64 (aarch64-apple-darwin) - Available on
macos-latestGitHub-hosted runner - ⏳ Windows amd64 (x86_64-pc-windows-msvc) - Available on
windows-latestGitHub-hosted runner - ⏳ Windows arm64 (aarch64-pc-windows-msvc) - Requires self-hosted runner or GitHub-hosted windows-11-arm runner when available
Note: Some platform combinations (ubuntu-24.04-arm, windows-11-arm) may require self-hosted runners or may not be available yet on GitHub Actions. To enable a platform, verify the runner is available and update the skip_build flag from true to false in the release workflow’s build matrix.
Troubleshooting
Release Workflow Fails
Problem: The release workflow fails during the build phase.
Solutions:
- Check the GitHub Actions logs for specific error messages
- Ensure all tests pass in the CI workflow before triggering a release
- Verify that the version number is valid semantic versioning
- Check that there are no uncommitted changes in the repository
Tag Already Exists
Problem: Cannot push a tag because it already exists.
Solutions:
- List existing tags:
git tag -l - Delete the local tag:
git tag -d vX.Y.Z - Delete the remote tag (if needed):
git push origin :refs/tags/vX.Y.Z - Create a new tag with a different version
Version Mismatch
Problem: The version in Cargo.toml doesn’t match the git tag.
Solutions:
- Ensure you’ve updated
Cargo.tomlbefore creating the tag - Or use
cargo-releasewhich handles this automatically - If using manual workflow dispatch, specify the version explicitly
Binary Not Building
Problem: A specific platform’s binary fails to build.
Solutions:
- Check if the platform is currently implemented (see Platform Support section)
- Ensure the
skip_buildflag is set correctly in the workflow - Verify that the build matrix includes the correct target triple
- Check platform-specific build logs for compilation errors
Release Not Appearing
Problem: Tag was pushed but no release was created.
Solutions:
- Verify the tag matches the pattern
vX.Y.Z(withvprefix) - Check the Actions tab to see if the workflow ran
- Look for errors in the workflow logs
- Ensure GitHub Actions has write permissions for releases
Best Practices
- Always test on main first: Ensure the main branch CI passes before creating a release
- Use semantic versioning: Follow the
MAJOR.MINOR.PATCHconvention - Write meaningful release notes: While auto-generated, consider editing them for clarity
- Use pre-releases for testing: Mark unstable versions as pre-releases
- Create draft releases for major versions: Review major releases before publishing
- Tag from main branch: Always create release tags from the main branch
- Keep version in sync: Ensure
Cargo.tomlversion matches the tag
Examples
Example 1: Regular Patch Release
# Update version
sed -i 's/version = "0.1.0"/version = "0.1.1"/' Cargo.toml
git add Cargo.toml
git commit -m "chore: bump version to 0.1.1"
git push origin main
# Create and push tag
git tag -a v0.1.1 -m "Release v0.1.1: Bug fixes and improvements"
git push origin v0.1.1
Example 2: Major Release via Workflow Dispatch
- Go to Actions → Release → Run workflow
- Set
versionto1.0.0 - Set
drafttotrue(to review before publishing) - Click “Run workflow”
- Review the draft release, edit notes if needed
- Publish the release
Example 3: Beta Release
# Update version
sed -i 's/version = "0.2.0"/version = "0.3.0-beta.1"/' Cargo.toml
git add Cargo.toml
git commit -m "chore: bump version to 0.3.0-beta.1"
git push origin main
# Create and push tag
git tag -a v0.3.0-beta.1 -m "Release v0.3.0-beta.1: Beta testing"
git push origin v0.3.0-beta.1
Or via workflow dispatch:
- Go to Actions → Release → Run workflow
- Set
versionto0.3.0-beta.1 - Set
prereleasetotrue - Click “Run workflow”