Skip to content

Cargo subcommand `release`: everything about releasing a rust crate.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

crate-ci/cargo-release

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c6e431c · Feb 20, 2025
May 2, 2024
Feb 20, 2025
Dec 12, 2024
Feb 5, 2025
Nov 4, 2024
Apr 26, 2024
Mar 9, 2016
Oct 26, 2023
Feb 5, 2025
Sep 27, 2024
Feb 5, 2025
Feb 5, 2025
Mar 29, 2023
Mar 29, 2023
Feb 18, 2025
Dec 1, 2022
May 29, 2024
Aug 17, 2018
Oct 19, 2022
Apr 1, 2024

Repository files navigation

cargo release

Streamline your crate release process

cargo release extends cargo publish with common release practices like validation, version management, tagging, and pushing. The process is customizable but with defaults that should help you get up and running quickly.

Features include:

  • Ensure you are in a good state for release, including:
    • Right branch
    • Up-to-date with remote
    • Clean tree
  • Supports workspaces using cargo's native flags, like --workspace, --exclude and --package
    • Updates dependent crates in workspace when changing version
    • Change detection to help guide in what crates might not need a release
    • Optionally share commits
  • Handles cargo publish, tagging, and pushing
  • Pre-release search and replace for custom version updates, including
  • Pre-release hook for extra customization, including

Install

Current release: 0.25.17

$ cargo install cargo-release

Usage

$ cargo release [level]
<dry-run output>
$ cargo release [level] --execute
  • See the reference for more on level, other CLI arguments, and configuration file format.
  • See also the FAQ for help in figuring out how to adapt cargo-release to your workflow.

Prerequisite

  • Your project should be managed by git.

Dry run

By default, cargo-release runs in dry-run mode so you can safely run it and verify what it will do.

  • Increase the logging level with each additional -v to get more details
  • Speed up dry-run by skipping cargo-publishs verify step with --no-verify

Once you are ready, pass the --execute flag.

Related tools

Semver Compatibility

cargo-release's versioning tracks compatibility for the binaries, not the API. We upload to crates.io to distribute the binary. If using this as a library, be sure to pin the version with a = version requirement operator.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.