Skip to content

Commit 29eb537

Browse files
committed
ci: integrate xtask-bump-check
1 parent 5417eac commit 29eb537

File tree

3 files changed

+14
-40
lines changed

3 files changed

+14
-40
lines changed

.cargo/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
build-man = "run --package xtask-build-man --"
33
stale-label = "run --package xtask-stale-label --"
44
unpublished = "run --package xtask-unpublished --"
5+
bump-check = "run --package xtask-bump-check --"

Cargo.lock

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ci/validate-version-bump.sh

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,4 @@ head_sha=$(git rev-parse "${HEAD_SHA:-HEAD}")
1919
echo "Base branch is $base_sha"
2020
echo "Current head is $head_sha"
2121

22-
# Gets crate names of members that has been changed from $bash_sha to $head_sha.
23-
changed_crates=$(
24-
git diff --name-only "$base_sha" "$head_sha" -- crates/ credential/ benches/ \
25-
| cut -d'/' -f2 \
26-
| sort -u
27-
)
28-
29-
if [ -z "$changed_crates" ]
30-
then
31-
echo "No file changed in member crates."
32-
exit 0
33-
fi
34-
35-
# Checks publish status for only crates with code changes.
36-
publish_status_table=$(
37-
echo "$changed_crates" \
38-
| xargs printf -- '--package %s\n' \
39-
| xargs cargo unpublished
40-
)
41-
42-
# "yes" -> code changed but no version difference -> need a bump
43-
# Prints 2nd column (sep by space), which is the name of the crate.
44-
crates_need_bump=$(
45-
echo "$publish_status_table" \
46-
| { grep '| yes ' || true; } \
47-
| awk '{print $2}'
48-
)
49-
50-
if [ -z "$crates_need_bump" ]
51-
then
52-
echo "No version bump needed for member crates."
53-
exit 0
54-
fi
55-
56-
echo "Detected changes in these crates but no version bump found:"
57-
echo "$crates_need_bump"
58-
echo
59-
echo "Please bump at least one patch version for each corresponding Cargo.toml:"
60-
echo 'Run "cargo unpublished" to read the publish status table for details.'
61-
exit 1
22+
cargo bump-check --baseline-rev "$base_sha"

0 commit comments

Comments
 (0)