Rollup merge of #151354 - weekly-update-script, r=jieyouxu

ci: Move lockfile updates to a script

This makes manual tweaking a little easier when there are issues.
This commit is contained in:
Jonathan Brouwer 2026-01-19 08:31:33 +01:00 committed by GitHub
commit 20262a2637
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 13 deletions

View file

@ -62,19 +62,9 @@ jobs:
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
rustup default $TOOLCHAIN
- name: cargo update compiler & tools
# Remove first line that always just says "Updating crates.io index"
run: |
echo -e "\ncompiler & tools dependencies:" >> cargo_update.log
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update library
run: |
echo -e "\nlibrary dependencies:" >> cargo_update.log
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update rustbook
run: |
echo -e "\nrustbook dependencies:" >> cargo_update.log
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
- name: cargo update
run: ./src/tools/update-lockfile.sh
- name: upload Cargo.lock artifact for use in PR
uses: actions/upload-artifact@v4
with:

18
src/tools/update-lockfile.sh Executable file
View file

@ -0,0 +1,18 @@
#!/bin/sh
# Updates the workspaces in `.`, `library` and `src/tools/rustbook`
# Logs are written to `cargo_update.log`
# Used as part of regular dependency bumps
set -euo pipefail
echo -e "\ncompiler & tools dependencies:" > cargo_update.log
# Remove first line that always just says "Updating crates.io index"
cargo update 2>&1 | sed '/crates.io index/d' | \
tee -a cargo_update.log
echo -e "\nlibrary dependencies:" >> cargo_update.log
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
tee -a cargo_update.log
echo -e "\nrustbook dependencies:" >> cargo_update.log
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
tee -a cargo_update.log