This document describes how to release Term to crates.io.
Term uses GitHub Releases to trigger automated publication to crates.io. When you create a GitHub release, our automated workflow handles all validation and publication steps.
- Update version in
term-guard/Cargo.toml - Update CHANGELOG.md with release notes (optional - you can use GitHub's auto-generated notes)
- Merge all changes to the main branch
- Ensure CI is green on the main branch
- Go to Releases → "Draft a new release"
- Click "Choose a tag" → Create new tag
v0.0.2(use your version withvprefix) - Set Release title:
v0.0.2(or add a codename likev0.0.2 - Lightning) - Generate release notes:
- Click "Generate release notes" to auto-populate from PRs
- Or manually write/paste your release notes
- Or copy from CHANGELOG.md if you maintain one
- If this is a test release, check "Set as a pre-release"
- Click "Publish release"
Once you publish the release, GitHub Actions automatically:
- Validates the release (version format, Cargo.toml match)
- Runs all tests and checks
- Publishes to crates.io (skip for pre-releases)
- Updates your release with publication links
Monitor progress in the Actions tab.
Use pre-releases to test the release process without publishing to crates.io:
- Check "Set as a pre-release" when creating the release
- Pre-releases run all validations but skip crates.io publication
- Users can test via git dependency:
[dependencies]
term-guard = { git = "https://github.com/withterm/term", tag = "v0.0.2-beta.1" }- Tags must be formatted as
vX.Y.Z(e.g.,v0.0.2,v1.0.0) - Version in
Cargo.tomlmust match (without thevprefix) - We follow Semantic Versioning
Add your crates.io token to GitHub:
- Get your token from https://crates.io/me
- Go to Settings → Secrets and variables → Actions
- Add secret named
CARGO_REGISTRY_TOKENwith your token
You need:
- Write access to the Term repository
- Publish rights on crates.io for
term-guard
If the release workflow fails:
- Check the Actions tab for errors
- Common issues:
- Version mismatch: Tag
v0.0.2must match Cargo.toml version0.0.2 - Missing secret: Ensure
CARGO_REGISTRY_TOKENis set - Test failures: Fix tests and create a new release
- Version mismatch: Tag
- Fix issues and create a new release (delete the failed one if needed)
If you published a broken version:
# Prevent new downloads (doesn't delete)
cargo yank --version 0.0.2 -p term-guard
# Undo if fixed
cargo yank --version 0.0.2 --undo -p term-guardThe entire release process is:
- Update version number
- Create GitHub release
- Let automation handle the rest
Simple, consistent, and reliable.