1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-03-06 16:56:30 +02:00

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
This commit is contained in:
michael-kerscher 2025-02-05 15:33:28 +01:00 committed by GitHub
parent c07ac40f90
commit 715a23e7a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 32 deletions

View File

@ -5,37 +5,14 @@ description: Install mdbook with the dependencies we need.
runs:
using: composite
steps:
# The --locked flag is important for reproducible builds. It also
# avoids breakage due to skews between mdbook and mdbook-svgbob.
- name: Install mdbook
run: cargo install mdbook --locked --version 0.4.37
run: ./install-mdbook.sh
shell: bash
- name: Install mdbook-svgbob
run: cargo install mdbook-svgbob --locked --version 0.2.1
shell: bash
- name: Install mdbook-pandoc and related dependencies
- name: Install dependencies for mdbook-pandoc
run: |
cargo install mdbook-pandoc --locked --version 0.9.3
sudo apt-get update
sudo apt-get install -y texlive texlive-luatex texlive-lang-cjk texlive-lang-arabic librsvg2-bin fonts-noto
curl -LsSf https://github.com/jgm/pandoc/releases/download/3.6.2/pandoc-3.6.2-linux-amd64.tar.gz | tar zxf -
echo "$PWD/pandoc-3.6.2/bin" >> $GITHUB_PATH
shell: bash
- name: Install mdbook-i18n-helpers
run: cargo install mdbook-i18n-helpers --locked --version 0.3.3
shell: bash
- name: Install i18n-report
run: cargo install i18n-report --locked --version 0.2.0
shell: bash
- name: Install mdbook-exerciser
run: cargo install --path mdbook-exerciser --locked
shell: bash
- name: Install mdbook-course
run: cargo install --path mdbook-course --locked
shell: bash

View File

@ -71,13 +71,7 @@ cd comprehensive-rust
Then install these tools with:
```shell
cargo install mdbook
cargo install --locked mdbook-svgbob
cargo install --locked mdbook-i18n-helpers
cargo install --locked i18n-report
cargo install --locked mdbook-linkcheck
cargo install --locked --path mdbook-exerciser
cargo install --locked --path mdbook-course
bash install-mdbook.sh
```
Run

11
install-mdbook.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/bash
# The --locked flag is important for reproducible builds. It also
# avoids breakage due to skews between mdbook and mdbook-svgbob.
cargo install mdbook --locked --version 0.4.37
cargo install mdbook-svgbob --locked --version 0.2.1
cargo install mdbook-pandoc --locked --version 0.9.3
cargo install mdbook-i18n-helpers --locked --version 0.3.3
cargo install i18n-report --locked --version 0.2.0
# these packages are located in this repository
cargo install --path mdbook-exerciser --locked
cargo install --path mdbook-course --locked