Skip to content

Commit 20262a2

Browse files
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.
2 parents d2375c2 + 0895c4c commit 20262a2

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.github/workflows/dependencies.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,9 @@ jobs:
6262
rustup toolchain install --no-self-update --profile minimal $TOOLCHAIN
6363
rustup default $TOOLCHAIN
6464
65-
- name: cargo update compiler & tools
66-
# Remove first line that always just says "Updating crates.io index"
67-
run: |
68-
echo -e "\ncompiler & tools dependencies:" >> cargo_update.log
69-
cargo update 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
70-
- name: cargo update library
71-
run: |
72-
echo -e "\nlibrary dependencies:" >> cargo_update.log
73-
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
74-
- name: cargo update rustbook
75-
run: |
76-
echo -e "\nrustbook dependencies:" >> cargo_update.log
77-
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | tee -a cargo_update.log
65+
- name: cargo update
66+
run: ./src/tools/update-lockfile.sh
67+
7868
- name: upload Cargo.lock artifact for use in PR
7969
uses: actions/upload-artifact@v4
8070
with:

src/tools/update-lockfile.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/sh
2+
3+
# Updates the workspaces in `.`, `library` and `src/tools/rustbook`
4+
# Logs are written to `cargo_update.log`
5+
# Used as part of regular dependency bumps
6+
7+
set -euo pipefail
8+
9+
echo -e "\ncompiler & tools dependencies:" > cargo_update.log
10+
# Remove first line that always just says "Updating crates.io index"
11+
cargo update 2>&1 | sed '/crates.io index/d' | \
12+
tee -a cargo_update.log
13+
echo -e "\nlibrary dependencies:" >> cargo_update.log
14+
cargo update --manifest-path library/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
15+
tee -a cargo_update.log
16+
echo -e "\nrustbook dependencies:" >> cargo_update.log
17+
cargo update --manifest-path src/tools/rustbook/Cargo.toml 2>&1 | sed '/crates.io index/d' | \
18+
tee -a cargo_update.log

0 commit comments

Comments
 (0)