File tree Expand file tree Collapse file tree 4 files changed +44
-9
lines changed
Expand file tree Collapse file tree 4 files changed +44
-9
lines changed Original file line number Diff line number Diff line change @@ -31,18 +31,17 @@ jobs:
3131 env :
3232 MDBOOK_VERSION : 0.4.52
3333 MDBOOK_MERMAID_VERSION : 0.10.0
34+ CARGO_HOME : ${{ github.workspace }}/.cargo
35+ RUSTUP_HOME : ${{ github.workspace }}/.rustup
36+ PATH : ${{ github.workspace }}/.cargo/bin:$PATH
3437 steps :
3538 - uses : actions/checkout@v4
3639 - name : Install mdBook
37- run : |
38- curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
39- rustup update
40- # Install mdbook v0.4.52 (required for mdbook-embedify compatibility)
41- cargo install --version ${MDBOOK_VERSION} mdbook
42- # Install mdbook-mermaid v0.10.0 (compatible with mdbook 0.4.52)
43- cargo install --version ${MDBOOK_MERMAID_VERSION} mdbook-mermaid
44- # Install mdbook-embedify (latest version compatible with mdbook 0.4.52)
45- cargo install mdbook-embedify
40+ run : bash scripts/install-mdbook.sh
41+ env :
42+ REPO_ROOT : ${{ github.workspace }}
43+ MDBOOK_VERSION : ${{ env.MDBOOK_VERSION }}
44+ MDBOOK_MERMAID_VERSION : ${{ env.MDBOOK_MERMAID_VERSION }}
4645 - name : Setup Pages
4746 id : pages
4847 uses : actions/configure-pages@v5
Original file line number Diff line number Diff line change 11# We want to ignore our vale StylesPath
22.github /vale /*
3+ # Rust toolchain when running CI locally (e.g. act)
4+ .rustup
5+ .cargo
36gqm * [pngmd ]
47book
58** /dist /
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Run the project's mdBook (avoids using global mdbook, which may have incompatible embedify).
3+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd) "
4+ exec " ${SCRIPT_DIR} /.cargo/bin/mdbook" " $@ "
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Install mdBook and plugins (same versions as CI). Safe to run locally.
3+ # Usage: ./scripts/install-mdbook.sh (from repo root)
4+ set -e
5+
6+ MDBOOK_VERSION=" ${MDBOOK_VERSION:- 0.4.52} "
7+ MDBOOK_MERMAID_VERSION=" ${MDBOOK_MERMAID_VERSION:- 0.10.0} "
8+
9+ # Install into repo so CI and local use the same layout (avoids cross-device issues in act)
10+ REPO_ROOT=" ${REPO_ROOT:- $(git rev-parse --show-toplevel 2>/ dev/ null || echo " $PWD " )} "
11+ export RUSTUP_HOME=" ${REPO_ROOT} /.rustup"
12+ export CARGO_HOME=" ${REPO_ROOT} /.cargo"
13+
14+ echo " Installing Rust and mdBook into ${REPO_ROOT} (RUSTUP_HOME=$RUSTUP_HOME , CARGO_HOME=$CARGO_HOME )"
15+
16+ curl --proto ' =https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
17+ source " ${CARGO_HOME} /env"
18+ rustup update
19+
20+ # Install mdbook v0.4.52 (required for mdbook-embedify compatibility)
21+ cargo install --version " ${MDBOOK_VERSION} " mdbook
22+ # Install mdbook-mermaid v0.10.0 (compatible with mdbook 0.4.52)
23+ cargo install --version " ${MDBOOK_MERMAID_VERSION} " mdbook-mermaid
24+ # Install mdbook-embedify (latest version compatible with mdbook 0.4.52)
25+ cargo install mdbook-embedify
26+
27+ echo " Done. To build the book, use the project mdbook (do not use your global 'mdbook'):"
28+ echo " ./mdbook build"
29+ echo " Or: source \" ${CARGO_HOME} /env\" && mdbook build"
You can’t perform that action at this time.
0 commit comments