This repository was archived by the owner on Apr 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Expand file tree Collapse file tree 1 file changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -31,17 +31,25 @@ cp target/debug/cargo-semver ~/rust/cargo/bin
31
31
cp target/debug/rust-semverver ~ /rust/cargo/bin
32
32
33
33
# become semververver
34
- PATH=~ /rust/cargo/bin:$PATH cargo semver | tee semver_out
35
- current_version=" $( grep -e ' ^version = .*$' Cargo.toml | cut -d ' ' -f 3) "
36
- current_version=" ${current_version% \" } "
37
- current_version=" ${current_version# \" } "
38
- result=" $( head -n 1 semver_out) "
39
- if echo " $result " | grep -- " -> $current_version " ; then
40
- echo " version ok"
41
- exit 0
34
+ #
35
+ # Note: Because we rely on rust nightly building the previously published
36
+ # semver can often fail. To avoid failing the build we first check
37
+ # if we can compile the previously published version.
38
+ if cargo install --root " $( mktemp -d) " semverver > /dev/null 2> /dev/null; then
39
+ PATH=~ /rust/cargo/bin:$PATH cargo semver | tee semver_out
40
+ current_version=" $( grep -e ' ^version = .*$' Cargo.toml | cut -d ' ' -f 3) "
41
+ current_version=" ${current_version% \" } "
42
+ current_version=" ${current_version# \" } "
43
+ result=" $( head -n 1 semver_out) "
44
+ if echo " $result " | grep -- " -> $current_version " ; then
45
+ echo " version ok"
46
+ exit 0
47
+ else
48
+ echo " versioning mismatch"
49
+ cat semver_out
50
+ echo " versioning mismatch"
51
+ exit 1
52
+ fi
42
53
else
43
- echo " versioning mismatch"
44
- cat semver_out
45
- echo " versioning mismatch"
46
- exit 1
54
+ echo ' Failed to check semver-compliance of semverver. Failed to compiled previous version.' >&2
47
55
fi
You can’t perform that action at this time.
0 commit comments