A while back I created a
new GitHub Action for releasing Rust projects
which produce binary releases (as opposed to crates). This works nicely with my
Rust Cross Action to let me
automate away most of the toil from releasing new versions of my Rust CLI tools like
precious
,
ubi
, and
omegasort
.
Using it is pretty simple and can be done in one step:
|
|
For a longer example, see how I use this action and my Rust Cross Action to
build, test, and release ubi
.
Right now, all it does is the following:
- Creates a tarball (most platforms) or zip file (Windows) with the executable, along with any extra
files that are requested. By default, it will include a changes file (defaults to
Changes.md
) and anything matchingREADME*
. - Creates a sha256 checksum file for this archive file.
- Uploads these two files as release artifacts for the workflow run in GitHub.
- Uses the GH Release Action to do the actual release publication on GitHub.
It’s not much, but I was copying the YAML config to do this between my Rust projects, so it made sense to turn this into its own standalone Action.
In the future, I might turn this into something a little more generic. The only Rust-specific piece
of it is that it knows where to cargo build
puts the executable file. But there’s no reason this
couldn’t work just as well for any other language capable of producing single-file binaries, like
Go.