This document describes how to release a new version of Clash.
- Ensure all tests pass:
cargo test - Update version in
Cargo.toml - Update
CHANGELOG.mdwith release notes - Commit all changes
- Set up crates.io token (one-time):
- Get token from https://crates.io/settings/tokens
- Add as
CARGO_REGISTRY_TOKENsecret in GitHub repo settings
-
Tag the release:
git tag v0.1.0 git push origin v0.1.0
-
GitHub Actions automatically:
- Creates a GitHub Release
- Builds binaries for all platforms:
- macOS (Intel & ARM)
- Linux (x64 & ARM)
- Windows (x64)
- Uploads binaries to the release
- Publishes to crates.io
- Updates Homebrew formula (if tap repo exists)
-
Manual steps after release:
- Verify binaries are uploaded to GitHub Release
- Test installation methods:
# Test curl installation curl -fsSL https://clash.sh/install.sh | sh # Test Homebrew (if tap is set up) brew update brew install clash-sh/tap/clash # Test crates.io (wait ~5 minutes for indexing) cargo install clash-sh
-
Create new repository:
github.com/clash-sh/homebrew-tap -
Create
Formula/directory in the repo -
Copy
homebrew/clash.rbtoFormula/clash.rb -
Create a GitHub token with repo access for the tap repository
-
Add the token as
TAP_GITHUB_TOKENsecret in main Clash repository
After release, users can install via:
curl -fsSL https://raw.githubusercontent.com/clash-sh/clash/main/install.sh | shbrew install clash-sh/tap/clash# macOS ARM
curl -LO https://github.com/clash-sh/clash/releases/latest/download/clash-aarch64-apple-darwin.tar.gz
tar -xzf clash-aarch64-apple-darwin.tar.gz
sudo mv clash /usr/local/bin/
# Linux x64
curl -LO https://github.com/clash-sh/clash/releases/latest/download/clash-x86_64-unknown-linux-gnu.tar.gz
tar -xzf clash-x86_64-unknown-linux-gnu.tar.gz
sudo mv clash /usr/local/bin/cargo install --git https://github.com/clash-sh/clashWe follow semantic versioning:
v0.1.0- Initial releasev0.1.1- Bug fixesv0.2.0- New featuresv1.0.0- Stable API
- Check GitHub Actions logs
- Ensure all target architectures build locally:
cargo build --target x86_64-apple-darwin cargo build --target aarch64-apple-darwin
- Check that
TAP_GITHUB_TOKENsecret is set - Verify token has write access to tap repository
- Check logs in the
update-homebrewjob
The install script falls back to source installation if binaries aren't available. This requires Rust to be installed.