From 665368f478e315a416aee741539f8bd648ab13c0 Mon Sep 17 00:00:00 2001 From: ParaN3xus Date: Wed, 7 Feb 2024 00:58:18 +0800 Subject: [PATCH] build: better mdbook install --- .github/workflows/mdbook.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/mdbook.yml b/.github/workflows/mdbook.yml index 40b1fb4..0ea476c 100644 --- a/.github/workflows/mdbook.yml +++ b/.github/workflows/mdbook.yml @@ -28,15 +28,14 @@ jobs: # Build job build: runs-on: ubuntu-latest - env: - MDBOOK_VERSION: 0.4.36 steps: - uses: actions/checkout@v4 - name: Install mdBook run: | - curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh - rustup update - cargo install --version ${MDBOOK_VERSION} mdbook + version=$(wget -qO- -t1 -T2 "https://api.github.com/repos/rust-lang/mdBook/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g') + wget "https://github.com/rust-lang/mdBook/releases/download/$version/mdbook-$version-x86_64-unknown-linux-gnu.tar.gz" + tar -xzf "mdbook-$version-x86_64-unknown-linux-gnu.tar.gz" + echo `pwd`/mdbook >> $GITHUB_PATH - name: Setup Pages id: pages uses: actions/configure-pages@v4