Skip to content

Commit de62620

Browse files
author
James Munns
committed
Implement installation using trust
1 parent 8dff895 commit de62620

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ matrix:
1919
before_script:
2020
- rustup component add rustfmt
2121
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
22-
- (test -x $HOME/.cargo/bin/mdbook || cargo install --vers "^0.3" mdbook)
22+
- (test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh)
2323
- cargo install-update -a
2424

2525
script:

ci/install-mdbook.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
set -euxo pipefail
2+
3+
# Based on the Rust-Embedded WG's book CI
4+
# https://github.com/rust-embedded/book/blob/master/ci/install.sh
5+
6+
main() {
7+
# Note - this will only accept releases tagged with v0.3.x
8+
local tag=$(git ls-remote --tags --refs --exit-code \
9+
https://github.com/rust-lang-nursery/mdbook \
10+
| cut -d/ -f3 \
11+
| grep -E '^v0.3.[0-9]+$' \
12+
| sort --version-sort \
13+
| tail -n1)
14+
15+
curl -LSfs https://japaric.github.io/trust/install.sh | \
16+
sh -s -- --git rust-lang-nursery/mdbook --tag $tag
17+
}
18+
19+
main

0 commit comments

Comments
 (0)