From 558ea2f9b09b43a3dedf8016fb5665b952b1908f Mon Sep 17 00:00:00 2001 From: rustmailer Date: Mon, 29 Dec 2025 12:25:05 +0800 Subject: [PATCH] Update release.yml --- .github/workflows/release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 84413d3..72aaedf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -34,6 +34,22 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Verify Cargo.toml version matches git tag + shell: bash + run: | + TAG_VERSION="${GITHUB_REF_NAME}" + + CARGO_VERSION=$(grep '^version\s*=' Cargo.toml | head -n1 | sed -E 's/version\s*=\s*"([^"]+)"/\1/') + + echo "Git tag version: $TAG_VERSION" + echo "Cargo.toml version: $CARGO_VERSION" + + if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then + echo "::error::Version mismatch! Git tag ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)" + exit 1 + fi + + - name: Install Rust uses: actions-rs/toolchain@v1 with: