Skip to content

Commit 2d45036

Browse files
committed
ci: Reorder steps in bump.yml workflow to fix upgrades from Git
We have an issue in the bump.yml workflow. It fails to update recursive dependencies for the project when these dependencies are passed as links to Git repositories (for example, a branch name and an URL to a GitHub repository). I'm not sure what happens exactly, but there seems to be an issue with the "cargo upgrade" command: it expects some local index to be populated when running the upgrade for the Git-based dependency, and calls "cargo update" under the hood with the "--offline" option, but this command fails. We've opened a GitHub issue for the upstream "cargo-edit" project (providing "cargo upgrade"), but in the meantime, let's re-order the commands we run: if we do the "cargo update" first, this should populate whatever index "cargo upgrade" seems to rely on when we try to bump the dependencies in Cargo.toml. See #491 for more context. Fixes: #491 Signed-off-by: Quentin Monnet <[email protected]>
1 parent e3522a0 commit 2d45036

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/bump.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,13 @@ jobs:
107107
git config user.email '<41898282+github-actions[bot]@users.noreply.github.com>'
108108
BASE="$(git rev-parse HEAD)"
109109
110+
# Run "cargo update"
111+
cargo update
112+
if ! git diff --quiet; then
113+
git add Cargo.lock
114+
git commit -sm "bump(cargo)!: bump dependencies (cargo update)"
115+
fi
116+
110117
# Check updates available with "cargo upgrade",
111118
# then bump each package individually through separate commits
112119
cargo upgrade --incompatible=allow --dry-run > upgrade_output.txt
@@ -124,13 +131,6 @@ jobs:
124131
git commit -sF commit_msg.txt
125132
done < list_packages.txt
126133
127-
# Run "cargo update"
128-
cargo update
129-
if ! git diff --quiet; then
130-
git add Cargo.lock
131-
git commit -sm "bump(cargo)!: bump dependencies (cargo update)"
132-
fi
133-
134134
# If we didn't create any commits, we don't need to create a PR message
135135
if [[ "$(git rev-parse HEAD)" = "${BASE}" ]]; then
136136
rm -f -- upgrade_output.txt list_packages.txt commit_msg.txt

0 commit comments

Comments
 (0)