From e1ae369d172240091735c7063f85d54c5052ac62 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 4 Sep 2024 23:51:42 -0600 Subject: [PATCH] CI: Fix Cargo.toml version check --- .github/workflows/build.yaml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 359d0a9..768bb0f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -29,15 +29,17 @@ jobs: if: startsWith(github.ref, 'refs/tags/') shell: bash run: | - set -eou - version=$(grep '^version' Cargo.toml | awk -F' = ' '{print $2}' | tr -d '"') - version="v$version" + set -eou pipefail tag='${{github.ref}}' tag="${tag#refs/tags/}" - if [ "$tag" != "$version" ]; then - echo "::error::Git tag doesn't match the Cargo version! ($tag != $version)" - exit 1 - fi + 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 - name: Setup Rust toolchain uses: dtolnay/rust-toolchain@stable with: