I’d like to automate my release processes, but I am not sure about the best practice here. I understand that Cargo offers no “custom tasks”, so how do you implement custom build tasks in your Rust projects?
I know that I could just write shell (Python, Ruby, etc.) scripts and put these in my source code, but I’d rather prefer if I did not need to setup two (or even more) language environments to work on my projects—in particular on Windows.
So what’s your recommendation or best practice here?
Regards.
PS: I’m aware of cargo-release but it doesn’t suite my needs. It seems to be geared towards manual releases, whereas I’d like my CI to take care of publishing, etc. and only do essential things locally, in particular bumping the version and updating the changelog.
You can do something like cargo new --bin tasks, and, write automation as usual Rust program, and then run it as cargo run --manifest-path ./tasks/Cargo.toml --bin task-foo. That way, you get a cross-platform “scripting” environment, which could use serde and other goodies from crates.io, provided that you have Cargo on the target machine.