From dc4840975ff2b30ab3d783be34fcf72dbc1c9fec Mon Sep 17 00:00:00 2001 From: Nick P Date: Wed, 15 Jul 2026 00:37:25 -0600 Subject: [PATCH] ci: verify release tag against the facade crate version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The publish workflow read `.packages[0].version` from cargo metadata and asserted it equalled the pushed tag. Because release-plz versions each crate independently, an unchanged crate (geometry-tag, geometry-derive) can lag the release, and `.packages[0]` may resolve to one of those laggards — failing the check even though the release is correct (v0.0.8 failed with "does not match workspace version v0.0.7"). Verify the tag against the facade crate `boost_geometry` specifically, which is what the release tag tracks. The downstream publish loop already tolerates per-crate versions (it skips crates already on crates.io), so no other change is needed. --- .github/workflows/publish.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 478ce93..f45ec6a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,12 +23,20 @@ jobs: uses: Swatinem/rust-cache@v2 - name: Test run: cargo test --workspace - - name: Verify tag matches workspace version + - name: Verify tag matches the facade crate version run: | + # release-plz versions each crate independently, so an unchanged + # crate (e.g. geometry-tag) can lag behind the release. The tag + # tracks the facade crate `boost_geometry` — verify against that, + # not an arbitrary `.packages[0]`. version="$(cargo metadata --no-deps --format-version 1 \ - | jq -r '.packages[0].version')" + | jq -r '.packages[] | select(.name == "boost_geometry") | .version')" + if [ -z "${version}" ]; then + echo "Could not read boost_geometry version from cargo metadata" >&2 + exit 1 + fi if [ "v${version}" != "${GITHUB_REF_NAME}" ]; then - echo "Tag ${GITHUB_REF_NAME} does not match workspace version v${version}" >&2 + echo "Tag ${GITHUB_REF_NAME} does not match boost_geometry version v${version}" >&2 exit 1 fi - name: Publish workspace crates in dependency order