#github #cache #bin #cargo-toml #cli #developer-experiance

app cargo-gha

Version lock, cache, and run binaries from any Github Release assets. Pull in external tools and keep the versions in sync across your team, and forget installing globally.

14 releases (3 stable)

1.0.2 Jan 2, 2024
0.4.6 Oct 6, 2023
0.4.5 Sep 22, 2023
0.3.0 Sep 4, 2023
0.1.2 Aug 22, 2023

#189 in Cargo plugins

Download history 179/week @ 2024-01-01 7/week @ 2024-02-12 34/week @ 2024-02-19 26/week @ 2024-02-26 10/week @ 2024-03-04 29/week @ 2024-03-11 200/week @ 2024-04-01

230 downloads per month

MIT license

95KB
626 lines

cargo-gha

cargo-gha

Version lock, cache, and run binaries from any Github Release assets. Pull in external tools and keep the versions in sync across your team, and forget installing globally.

Overview

A companion tool to cargo-run-bin, cargo-gha handles downloading and persisting tools from any Github Release assets, keeping versions available and in sync across your team.

asciicast

Install

Run the following to install cargo-gha, and ignore the cache directory in your project.

cargo install cargo-gha
echo ".gha/" >> .gitignore

Or if using cargo-run-bin, add it Cargo.toml.

[package.metadata.bin]
cargo-gha = { version = "1.0.0" }
cargo bin --sync-aliases
echo ".gha/" >> .gitignore

Usage

cargo-gha has an interactive experience to add assets to Cargo.toml. Before starting, you must specify the target architectures you and your team use.

[package.metadata.gha]
targets = ["x86_64-apple-darwin", "x86_64-unknown-linux-gnu"]

Once set, run the following to add an asset and follow the steps. As an example, let's add ProtocolBuffer's protoc.

cargo gha --add protocolbuffers/protobuf
# Or
cargo gha --add https://github.com/protocolbuffers/protobuf

Installed! protoc is now available through cargo-gha. Try it!

cargo gha protoc --help

cargo gha BINARY

Taking an example of protoc, running cargo gha protoc --help with install and cache the protoc binary with the specified version in Cargo.toml. All future executions will run instantly without an install step, and protoc can be used as you wish!

cargo gha --install

When pulling down a new repo, or adding a step to CI, cargo gha --install will install all assets that have not been cached which are configured in Cargo.toml.

License

MIT.

Dependencies

~30–68MB
~1M SLoC