Merge pull request #116 from async-rs/install-mdbook-bin

Implement installation using trust
staging
Florian Gilcher 5 years ago committed by GitHub
commit d89b384620
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,26 +1,22 @@
language: rust
env:
- RUSTFLAGS="-D warnings"
matrix:
fast_finish: true
include:
- rust: nightly
os: linux
env: BUILD_DOCS=1 BUILD_BOOK=1
env: RUSTFLAGS="-D warnings" BUILD_DOCS=1 BUILD_BOOK=1
- rust: nightly
os: osx
osx_image: xcode9.2
env: BUILD_DOCS=1
env: RUSTFLAGS="-D warnings" BUILD_DOCS=1
- rust: nightly-x86_64-pc-windows-msvc
os: windows
env: RUSTFLAGS="-D warnings"
before_script:
- rustup component add rustfmt
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.3" mdbook)
- cargo install-update -a
- if [[ -n "$BUILD_BOOK" ]]; then (test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh); fi
script:
- if ! [[ -n "$BUILD_BOOK" ]]; then cargo check --all --benches --bins --examples --tests && cargo test --all; fi

@ -0,0 +1,19 @@
set -euxo pipefail
# Based on the Rust-Embedded WG's book CI
# https://github.com/rust-embedded/book/blob/master/ci/install.sh
main() {
# Note - this will only accept releases tagged with v0.3.x
local tag=$(git ls-remote --tags --refs --exit-code \
https://github.com/rust-lang-nursery/mdbook \
| cut -d/ -f3 \
| grep -E '^v0\.3\.[0-9]+$' \
| sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- --git rust-lang-nursery/mdbook --tag $tag
}
main
Loading…
Cancel
Save