Skip to content

Commit 715a23e

Browse files
Create install-mdbook.sh and lock to the current versions used in the CI (#2626)
Move mdbook installation into a script and use exact versions from the CI. Update README.md to instruct developers to use the same versions as the CI to sync both environments. This is related to #2620 and it fixes #2588
1 parent c07ac40 commit 715a23e

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

.github/workflows/install-mdbook/action.yml

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,14 @@ description: Install mdbook with the dependencies we need.
55
runs:
66
using: composite
77
steps:
8-
# The --locked flag is important for reproducible builds. It also
9-
# avoids breakage due to skews between mdbook and mdbook-svgbob.
108
- name: Install mdbook
11-
run: cargo install mdbook --locked --version 0.4.37
9+
run: ./install-mdbook.sh
1210
shell: bash
1311

14-
- name: Install mdbook-svgbob
15-
run: cargo install mdbook-svgbob --locked --version 0.2.1
16-
shell: bash
17-
18-
- name: Install mdbook-pandoc and related dependencies
12+
- name: Install dependencies for mdbook-pandoc
1913
run: |
20-
cargo install mdbook-pandoc --locked --version 0.9.3
2114
sudo apt-get update
2215
sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto
2316
curl -LsSf https://github.com/jgm/pandoc/releases/download/3.6.2/pandoc-3.6.2-linux-amd64.tar.gz | tar zxf -
2417
echo "$PWD/pandoc-3.6.2/bin" >> $GITHUB_PATH
2518
shell: bash
26-
27-
- name: Install mdbook-i18n-helpers
28-
run: cargo install mdbook-i18n-helpers --locked --version 0.3.3
29-
shell: bash
30-
31-
- name: Install i18n-report
32-
run: cargo install i18n-report --locked --version 0.2.0
33-
shell: bash
34-
35-
- name: Install mdbook-exerciser
36-
run: cargo install --path mdbook-exerciser --locked
37-
shell: bash
38-
39-
- name: Install mdbook-course
40-
run: cargo install --path mdbook-course --locked
41-
shell: bash

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,7 @@ cd comprehensive-rust
7171
Then install these tools with:
7272

7373
```shell
74-
cargo install mdbook
75-
cargo install --locked mdbook-svgbob
76-
cargo install --locked mdbook-i18n-helpers
77-
cargo install --locked i18n-report
78-
cargo install --locked mdbook-linkcheck
79-
cargo install --locked --path mdbook-exerciser
80-
cargo install --locked --path mdbook-course
74+
bash install-mdbook.sh
8175
```
8276

8377
Run

install-mdbook.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
# The --locked flag is important for reproducible builds. It also
3+
# avoids breakage due to skews between mdbook and mdbook-svgbob.
4+
cargo install mdbook --locked --version 0.4.37
5+
cargo install mdbook-svgbob --locked --version 0.2.1
6+
cargo install mdbook-pandoc --locked --version 0.9.3
7+
cargo install mdbook-i18n-helpers --locked --version 0.3.3
8+
cargo install i18n-report --locked --version 0.2.0
9+
# these packages are located in this repository
10+
cargo install --path mdbook-exerciser --locked
11+
cargo install --path mdbook-course --locked

0 commit comments

Comments
 (0)