Use workspace keys in Cargo.toml

This commit is contained in:
2024-09-09 19:32:22 -06:00
parent bcc5871cd8
commit 3d2236de82
6 changed files with 36 additions and 29 deletions

View File

@@ -32,14 +32,12 @@ jobs:
set -eou pipefail
tag='${{github.ref}}'
tag="${tag#refs/tags/}"
for file in */Cargo.toml; do
version=$(grep '^version' $file | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
done
version=$(grep '^version' Cargo.toml | head -1 | awk -F' = ' '{print $2}' | tr -d '"')
version="v$version"
if [ "$tag" != "$version" ]; then
echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)"
exit 1
fi
- name: Setup Rust toolchain
uses: dtolnay/rust-toolchain@stable
with: