Open epage opened 6 years ago
Started stager
Other relevant crate work
I make a tarball and a zip with Mac and Windows binaries + Linux packages together:
This is important for me, because I can have a single "Download" link on a static website and it works for everyone.
So I'm afraid that's a bit too much to explain to Cargo using TOML syntax, and in general I can't imagine one run of cargo
being able to compile and package for 3 platforms at once (and I still haven't managed to even set up cross-compilation).
I do like how npm
allows running arbitrary scripts with npm run script-name
where script-name
is defined in package.json
, so I can stuff my build steps there.
I make a tarball and a zip with Mac and Windows binaries + Linux packages together: This is important for me, because I can have a single "Download" link on a static website and it works for everyone.
I'm assuming this approach is a minority case and from that, I think I'm going to say its outside of the scope of being handled by this issue.
I'm starting to work on https://github.com/crate-ci/example-bin but finding teaching this annoying.
From the shell scripts, we have no idea what the crate name is, the bin name, or the target. The last is the most invasive for people get working.
Proposal
stager
Create a crate for staging files for tarballs or package managers
struct
{{ target_dir }}
cargo-tarball
The source is a Cargo.toml like:
metadata.tarball.my_bin
: Is the name to use when wanting to build a specific tarball (cargo tarball mybin
).default
is what will be built of nothing is named on the command linebin=true
: This is short hand for build all binsbin="bin_name"
would build and include a specific onebin=["bin1, "bin2"]
will build and include a group of themmetadata.tarball.my_bin.content
: this table is for adding additional files"{{ target_dir}}/my_bin.bash" = "completions"
: This uses a variable to find completions and put them in a directory"*.md" = "docs"
: This uses globs to grab all documentation in the root"*.md" = "docs"
expands to`"*.md" = { dest= "docs"
}`.