mirror of https://github.com/encounter/objdiff.git
CI: Fix Cargo.toml version check
This commit is contained in:
parent
ce05d6d6c0
commit
e1ae369d17
|
@ -29,15 +29,17 @@ jobs:
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
if: startsWith(github.ref, 'refs/tags/')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
set -eou
|
set -eou pipefail
|
||||||
version=$(grep '^version' Cargo.toml | awk -F' = ' '{print $2}' | tr -d '"')
|
|
||||||
version="v$version"
|
|
||||||
tag='${{github.ref}}'
|
tag='${{github.ref}}'
|
||||||
tag="${tag#refs/tags/}"
|
tag="${tag#refs/tags/}"
|
||||||
if [ "$tag" != "$version" ]; then
|
for file in */Cargo.toml; do
|
||||||
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
|
version=$(grep '^version' $file | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
|
||||||
exit 1
|
version="v$version"
|
||||||
fi
|
if [ "$tag" != "$version" ]; then
|
||||||
|
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
done
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
with:
|
with:
|
||||||
|
|
Loading…
Reference in New Issue