rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.73k stars 1.61k forks source link

Add a way to obtain the binary of the latest release for a given target #781

Open gnzlbg opened 6 years ago

gnzlbg commented 6 years ago

When using mdBook in CI it would be very useful to be easily able to programmatically obtain the latest binary for a given target, so that one can just do:

wget ... mdbook-latest-x86_64-unknown-linux-gnu.extension
..extract..
ln -sf mdbook-latest-x86_64-unknown-linux-gnu/mdbook
mdbook --version
mdbook build ...

without having to hard-code a version number anywhere. Since I'd like to be notified if a new version breaks things, I currently have to use cargo install mdbook for this, which takes a lot of CI time.

badboy commented 6 years ago

You can do that. mdbook binary releases are build using trust and it offers a handy install script: https://github.com/japaric/trust/#use-the-binary-releases-on-travis-ci

Add this to your CI config:

curl -LSfs https://japaric.github.io/trust/install.sh | sh -s -- --git rust-lang-nursery/mdBook