boozook / mdbook-svgbob

SvgBob mdbook preprocessor which swaps code-blocks with neat SVG.
Mozilla Public License 2.0
76 stars 8 forks source link

Refactor release pipeline #21

Open jontze opened 1 year ago

jontze commented 1 year ago

This PR refactors mainly the build step of the release pipeline to compile multiple binaries for the most popular targets.

Further, I removed the usage of the actions-rs/* actions, as the github organization is only maintained by one person that doesn't seem to work on this project any more. The actions in this organization are already affected of some deprecations that will break workflows in the next year. And as there is always a recent stable rust version installed on the github runner, there is no need to setup a recent stable rust version manually. actions-rs/toolchain#216

To ensure proper caching I also moved to another popular action in the rust ecosystem that specifically ensures the caching of cargo and rust (https://github.com/Swatinem/rust-cache). So we don't have to mess manually with the cache.

Additionally to the already existing tag, the release workflow now also creates a Github Release with the name of the tag and the compiled binaries for each target platform attached to the release and tag.

As a result, users are now able to download the precompiled binaries of mdbook-svgbob for the most popular target platforms and can get started without going through the compilation process and the installation of cargo / rust. This happens automated for every pushed tag starting with v.

You can see an example of such a release on my fork: https://github.com/jontze/mdbook-svgbob/releases/tag/v0.0.7 I could test everything beside of the windows and macOS binaries and obviously the publishing to crates.io.

If you disagree with some decisions I made, let me know and I'm happy to adjust the workflow :)

jontze commented 1 year ago

Thanks for your feedback @mgeisler! I pushed a commit addressing it. I'll squash the fixup after approval @boozook

EDIT: For some reason github automatically removed the requested review from @boozook :shrug:

boozook commented 11 months ago

Also do not forget to add secrets.CARGO_REGISTRY_TOKEN, @mgeisler. I hope you have rights for it. If not - feel free to reach me.

boozook commented 11 months ago

Okay, I've just added my token CARGO_REGISTRY_TOKEN. Should works.

Screenshot 2023-08-03 at 10 50 08