Skip to content

Commit 4dc245f

Browse files
committed
Updated release workflow to check Cargo.toml version against tag.
1 parent a2cd290 commit 4dc245f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ jobs:
4141
with:
4242
ref: ${{ steps.get_version.outputs.tag_name }}
4343

44+
- name: Verify Cargo.toml version matches tag
45+
run: |
46+
CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
47+
TAG_VERSION=${{ steps.get_version.outputs.version }}
48+
if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
49+
echo "::error::Version mismatch! Cargo.toml has $CARGO_VERSION but tag is $TAG_VERSION"
50+
exit 1
51+
fi
52+
echo "Version check passed: $CARGO_VERSION"
53+
4454
- name: Create Release
4555
id: create_release
4656
uses: softprops/action-gh-release@v2

0 commit comments

Comments
 (0)