Skip to content

Commit

Permalink
just download pre-built binaries instead of compiling them on the VM
Browse files Browse the repository at this point in the history
  • Loading branch information
tomeichlersmith committed Feb 25, 2025
1 parent 5734b16 commit 7de3a32
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 deletions.
21 changes: 21 additions & 0 deletions .github/install-mdbook
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh

set -o errexit
set -o nounset

# Assume the environment variables MDBOOK_VERSION and MDBOOK_ADMONISH_VERSION are set

# Download a tar ball and then unpack it into a destination
# Arguments
# 1 - URL for the .tar.gz to download
# 2 - target directory to unpack into
download() {
wget -q -O - "${1}" | tar -xz --directory "${2}"
}

download \
https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
~/.local/bin
download \
https://github.com/tommilligan/mdbook-admonish/releases/download/v${MDBOOK_ADMONISH_VERSION}/mdbook-admonish-v${MDBOOK_ADMONISH_VERSION}-x86_64-unknown-linux-gnu.tar.gz \
~/.local/bin
14 changes: 1 addition & 13 deletions .github/workflows/mdbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,8 @@ jobs:
MDBOOK_ADMONISH_VERSION: 1.19.0 # need to re-run mdbook-admonish install if updating version
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ env.MDBOOK_VERSION }}-${{ env.MDBOOK_ADMONISH_VERSION }}
- name: Install mdBook
run: |
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh
rustup update
cargo install --version ${MDBOOK_VERSION} --locked mdbook
cargo install --version ${MDBOOK_ADMONISH_VERSION} --locked mdbook-admonish
run: ./.github/install-mdbook
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
Expand Down

0 comments on commit 7de3a32

Please sign in to comment.