Release-plz: release Rust packages from CI
Releasing Rust packages is tedious and error-prone, just like most IT manual tasks. For every package you want to release, you need to:
Meet?release-plz: a Rust open-source project that automates these tasks, allowing developers to release Rust packages without the command line.
Features
How does it work
The recommended way to run release-plz is via the?GitHub action.
By default, every time you merge a commit to the main branch, the GitHub action runs two commands:?release-plz release-pr?and?release-plz release.
Creating a release pull request
The?release-plz release-pr?command opens a pull request that prepares the next release. The command:
When the project maintainer merges the release pull request, the packages are ready to be published.
Here’s an example of a?PR?opened by release-plz in the release-plz GitHub project itself:
Releasing all updated packages
The?release-plz release?command releases all the packages with a new version.
For example, let’s say you have a workspace with two packages:?pkg-a?(version 0.3.1) and?pkg-b?(version 0.2.2). The crates.io registry contains?pkg-a?version 0.3.1, but it doesn’t contain?pkg-b?version 0.2.2 because you didn’t publish this version yet. In this case, release-plz would release?pkg-b.
For every release, release-plz:
Releases made easy
In short, release-plz makes releasing Rust packages child’s play:
Release-plz makes releasing Rust packages as easy as clicking the pull request “merge” button.
领英推荐
Why yet another release tool
New Rust apps and rewrites are mushrooming every day. Choosing which tools to add to your developer toolbox is becoming harder and harder.
I feel obliged to explain why I created this project and how it compares with similar tools.
Differences with release-please
I learned about the “pull request driven release flow” from the article?My ideal Rust workflow?by?fasterthanlime, where he talks about?release-please. I immediately felt like release-please could fit great with the way I work, so I decided to try it. Like release-plz, release-please is an open-source project that manages releases via pull requests. I tried release-please both with the GitHub action and the CLI, but it didn’t work for me:
Most of the problems listed above mainly exist because release-please aims to support different programming languages. So I thought:
What if I write a tool specifically optimized for Rust that solves all the problems I have experienced? A tool that works out-of-the-box with nearly every Rust project, without any extra configuration.
It took six months of my spare time to write release-plz, but here we are!
Differences with other Rust release tools
These are the release tools in the Rust ecosystem I am aware of:
To respect the “Unix philosophy”, I tried to delegate the release flow to?cargo-release?and?cargo-workspaces. However, after discussing with the maintainers?here?and?here, I decided to implement the?release-plz release?command by myself.
Overall, I wasn’t satisfied with the existing Rust release tools because:
Conclusion
Using?release-plz?increased my productivity. Having an automated release pipeline helps you deliver at a faster pace, with a lower risk of manual mistakes.
If you try?release-plz, please let me know on?Twitter. Also, make sure to open?issues?for feature requests or bug reports!
Check out my other blog posts at?https://www.marcoieni.com/???