From 715a23e7a8c5f8ef98f869d058487bae2c88fe0b Mon Sep 17 00:00:00 2001 From: michael-kerscher Date: Wed, 5 Feb 2025 15:33:28 +0100 Subject: [PATCH] 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 --- .github/workflows/install-mdbook/action.yml | 27 ++------------------- README.md | 8 +----- install-mdbook.sh | 11 +++++++++ 3 files changed, 14 insertions(+), 32 deletions(-) create mode 100755 install-mdbook.sh diff --git a/.github/workflows/install-mdbook/action.yml b/.github/workflows/install-mdbook/action.yml index db8e9f303401..d46db7580deb 100644 --- a/.github/workflows/install-mdbook/action.yml +++ b/.github/workflows/install-mdbook/action.yml @@ -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 diff --git a/README.md b/README.md index 0f74ff7cf1fb..db7ca9639cc6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/install-mdbook.sh b/install-mdbook.sh new file mode 100755 index 000000000000..04e690d6a1ff --- /dev/null +++ b/install-mdbook.sh @@ -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