From 670e649d8377c4e5e8b3892fef1d704d4d606f11 Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 21 May 2026 12:50:48 -0300 Subject: [PATCH] ci: verify release tag against crate version instead of overwriting rust-sdk release.yml merged (#37) before the umbrella contract settled on manifest-as-source-of-truth versioning. Bring it in line with the other SDKs: - Add a verify job that checks the pushed tag equals the Cargo.toml version and fails fast on mismatch, before build/test/publish. - Drop the step that rewrote Cargo.toml from the tag; cargo publish no longer needs --allow-dirty. - Point the umbrella contract comment at the renamed reference/sdk-pipeline.md. Verification: workflow YAML syntactically validated only; not executed. --- .github/workflows/release.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index df6b310..2c4fd9d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,13 +1,27 @@ name: Release # Conforms to the umbrella SDK release pipeline contract: -# u5c-factory reference/sdk-pipeline-requirements.md +# u5c-factory reference/sdk-pipeline.md on: push: tags: ['v*'] jobs: + verify: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Verify tag matches crate version + run: | + TAG="${GITHUB_REF_NAME#v}" + MANIFEST=$(sed -nE 's/^version = "(.+)"/\1/p' Cargo.toml | head -1) + if [ "$TAG" != "$MANIFEST" ]; then + echo "::error::tag $GITHUB_REF_NAME does not match Cargo.toml version $MANIFEST" + exit 1 + fi + build: + needs: verify runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -32,12 +46,7 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - uses: Swatinem/rust-cache@v2 - - - name: Set crate version from tag - run: sed -i -E 's/^version = .*/version = "'"${GITHUB_REF_NAME#v}"'"/' Cargo.toml - - name: Publish to crates.io env: - # --allow-dirty: the version edit above leaves Cargo.toml modified in-tree. CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo publish -p utxorpc --allow-dirty + run: cargo publish -p utxorpc