Skip to content

Commit e1ae369

Browse files
committed
CI: Fix Cargo.toml version check
1 parent ce05d6d commit e1ae369

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

.github/workflows/build.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,17 @@ jobs:
2929
if: startsWith(github.ref, 'refs/tags/')
3030
shell: bash
3131
run: |
32-
set -eou
33-
version=$(grep '^version' Cargo.toml | awk -F' = ' '{print $2}' | tr -d '"')
34-
version="v$version"
32+
set -eou pipefail
3533
tag='${{github.ref}}'
3634
tag="${tag#refs/tags/}"
37-
if [ "$tag" != "$version" ]; then
38-
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
39-
exit 1
40-
fi
35+
for file in */Cargo.toml; do
36+
version=$(grep '^version' $file | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
37+
version="v$version"
38+
if [ "$tag" != "$version" ]; then
39+
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
40+
exit 1
41+
fi
42+
done
4143
- name: Setup Rust toolchain
4244
uses: dtolnay/rust-toolchain@stable
4345
with:

0 commit comments

Comments
 (0)