Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(deploy-docs): install mdbook with install-action #4157

Merged
merged 4 commits into from
Jan 17, 2025

Conversation

rami3l
Copy link
Member

@rami3l rami3l commented Jan 17, 2025

This PR uses the install-action to install mdbook, giving us access to the new features and/or fixes from the upstream.

We're already depending on the very same action to install taplo:

- name: Install taplo
uses: taiki-e/install-action@v2
with:
tool: taplo-cli

@ChrisDenton
Copy link
Member

ChrisDenton commented Jan 17, 2025

Maybe it could also be used here:

- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo "`pwd`/mdbook" >> $GITHUB_PATH

And here:

- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo "`pwd`/mdbook" >> $GITHUB_PATH

@rami3l
Copy link
Member Author

rami3l commented Jan 17, 2025

Maybe it could also be used here:

- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo "`pwd`/mdbook" >> $GITHUB_PATH

And here:

- name: Install mdbook
run: |
mkdir mdbook
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.37/mdbook-v0.4.37-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo "`pwd`/mdbook" >> $GITHUB_PATH

@ChrisDenton Thanks for pointing that out! I actually think these two jobs should be merged so these books can be tested on PR using the same workflow. I'll try to do that and delete this job...

.github/workflows/ci.yaml Outdated Show resolved Hide resolved
@rami3l rami3l marked this pull request as draft January 17, 2025 06:28
@rami3l rami3l marked this pull request as ready for review January 17, 2025 06:34
@rami3l rami3l added this pull request to the merge queue Jan 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 17, 2025
@rami3l rami3l added this pull request to the merge queue Jan 17, 2025
Merged via the queue into rust-lang:master with commit 69f8d66 Jan 17, 2025
29 checks passed
@rami3l rami3l deleted the ci/auto-mdbook branch January 17, 2025 07:52
@ehuss
Copy link
Contributor

ehuss commented Jan 17, 2025

FWIW, I do not recommend doing this without pinning to a specific version. It is not unusual that new releases break things, and it's best to test new versions and look at how it renders before updating. (Fortunately the rustup book is pretty basic, so problems are less likely, but I still wouldn't recommend it.)

@rami3l
Copy link
Member Author

rami3l commented Jan 18, 2025

FWIW, I do not recommend doing this without pinning to a specific version. It is not unusual that new releases break things, and it's best to test new versions and look at how it renders before updating. (Fortunately the rustup book is pretty basic, so problems are less likely, but I still wouldn't recommend it.)

@ehuss Thanks for the feedback! I have a question about this though:

When making this PR I thought, at least for me, it would be the best if we use the same version for local preview (I use the watch command when editing the book on my machine) and for deployment, and IIRC I've already noticed a few updates (but no breakages so far) with my local render compared to the online version...

Are we supposed to use like a one-year-old mdbook version locally, or is there a convenient way to check within our CI pipeline? Also, what kind of breakages do you have in mind?

PS: Pinning the version would simply be two extra lines in this new setup, I've done this before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants