Release Guide for mimic
This document describes how to create releases and publish the mimic crate to crates.io.
Prerequisites
Before creating a release, ensure:
- All tests pass:
cargo test --all-features - Documentation builds:
cargo doc --all-features --no-deps - Examples compile:
cargo build --examples --all-features - CHANGELOG.md is updated with changes for this version
- Version in Cargo.toml matches the release tag
- CARGO_REGISTRY_TOKEN secret is configured in GitHub repository settings
Setting Up crates.io Token
To publish to crates.io, you need to set up the CARGO_REGISTRY_TOKEN secret:
-
Get your crates.io API token:
- Log in to https://crates.io
- Go to Account Settings → API Tokens
- Click “New Token”
- Give it a name like “mimic-releases”
- Copy the token (you won’t be able to see it again)
-
Add the secret to GitHub:
gh secret set CARGO_REGISTRY_TOKEN # Paste your token when promptedOr manually via GitHub UI:
- Go to repository Settings → Secrets and variables → Actions
- Click “New repository secret”
- Name:
CARGO_REGISTRY_TOKEN - Value: Your crates.io token
Release Process
Option 1: Tag-based Release (Recommended)
-
Update version in Cargo.toml:
[package] version = "0.1.0" # Change to your target version -
Update CHANGELOG.md with release notes
-
Commit changes:
git add Cargo.toml CHANGELOG.md git commit -m "chore: prepare release v0.1.0" -
Create and push a tag:
git tag -a v0.1.0 -m "Release v0.1.0" git push origin main git push origin v0.1.0 -
GitHub Actions will automatically:
- Run all tests
- Create a GitHub release with changelog
- Publish to crates.io
- Build and deploy documentation to GitHub Pages
Option 2: Manual Trigger
You can also trigger a release manually via GitHub Actions:
- Go to the repository on GitHub
- Click “Actions” → “Release” workflow
- Click “Run workflow”
- Enter the version (e.g.,
v0.1.0) - Click “Run workflow”
Release Checklist
Before creating a release, verify:
- All tests pass:
cargo test --all-features - Clippy is happy:
cargo clippy --all-features -- -D warnings - Documentation builds:
cargo doc --all-features --no-deps - Examples compile:
cargo build --examples --all-features - Version in Cargo.toml matches release tag
- CHANGELOG.md is updated with release notes
- All open issues addressed in this release are documented
- README.md examples are up to date
- Breaking changes are documented (if any)
- Migration guide exists (if breaking changes)
Versioning
mimic follows Semantic Versioning:
- MAJOR version for incompatible API changes
- MINOR version for new functionality (backward-compatible)
- PATCH version for bug fixes (backward-compatible)
Pre-releases
For alpha, beta, or release candidate versions:
git tag -a v0.2.0-alpha.1 -m "Release v0.2.0-alpha.1"
git push origin v0.2.0-alpha.1The workflow will automatically mark these as pre-releases.
Post-Release
After a successful release:
-
Announce the release:
- Post in Ratatui Discord
- Tweet about it (if significant)
- Update dgx-pixels to use the new version
-
Monitor for issues:
- Watch GitHub issues
- Check crates.io download stats
- Monitor CI/CD for any failures
-
Update project board:
- Close completed milestones
- Create new milestone for next version
Troubleshooting
Release fails with “version mismatch”
Ensure the version in Cargo.toml matches the git tag:
- Tag
v0.1.0requires Cargo.toml version0.1.0(without ‘v’ prefix)
Release fails with “authentication required”
The CARGO_REGISTRY_TOKEN secret is missing or invalid:
gh secret set CARGO_REGISTRY_TOKEN
# Enter your crates.io API tokenDocumentation deployment fails
Check that GitHub Pages is enabled:
- Repository Settings → Pages
- Source: “Deploy from a branch”
- Branch: “gh-pages”
Tests fail on release
Always test before tagging:
cargo test --all-features
cargo clippy --all-features -- -D warningsRelease Workflow Details
The .github/workflows/release.yml workflow consists of three jobs:
1. create-release
- Extracts version from tag
- Generates changelog from git commits
- Creates GitHub release (draft for pre-releases)
2. publish-crate
- Verifies version matches tag
- Runs full test suite
- Publishes to crates.io
3. build-docs
- Builds documentation with all features
- Creates index redirect
- Deploys to GitHub Pages (if configured)
First Release Checklist
For the first v0.1.0 release:
- Set up CARGO_REGISTRY_TOKEN secret
- Verify crate name availability on crates.io
- Ensure all metadata in Cargo.toml is correct:
- description
- repository
- license
- keywords (max 5)
- categories
- Add comprehensive README.md
- Include LICENSE file
- Verify all examples work
- Complete all documentation
- Close or address issues #1, #7, #8