From 67b72477d99d46f3557fede0ed14d9748a5fd210 Mon Sep 17 00:00:00 2001 From: Platform Bot Date: Fri, 26 Jun 2026 10:41:16 +0000 Subject: [PATCH] ci: add version gate to publish workflow (DAK-7231) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verify pyproject.toml version matches the release tag BEFORE building or publishing. Fails immediately with a clear fix instruction if there is a mismatch, preventing registry rejections (PyPI "file already exists") caused by releasing against an unbumped manifest. Root cause of DAK-7230 — three SDK publishes failed 2026-06-26 because GitHub Releases were created before the version was bumped. --- .github/workflows/release.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1339bf..8b84063 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,6 +18,22 @@ jobs: steps: - uses: actions/checkout@v7 + - name: Verify manifest version matches release tag + run: | + TAG_VERSION="${{ github.ref_name }}" + TAG_VERSION="${TAG_VERSION#v}" + MANIFEST_VERSION=$(grep -m1 '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') + if [ "$MANIFEST_VERSION" != "$TAG_VERSION" ]; then + echo "❌ Version mismatch: pyproject.toml='$MANIFEST_VERSION' release tag='$TAG_VERSION'" + echo "" + echo "Fix: bump pyproject.toml and src/dakera/__init__.py to '$TAG_VERSION'," + echo "commit on the target SHA, delete this release, then recreate it on the bumped commit." + echo "" + echo "Root cause of DAK-7230 — this gate prevents registry rejects on version conflict." + exit 1 + fi + echo "✅ Version verified: pyproject.toml=$MANIFEST_VERSION matches release tag ${{ github.ref_name }}" + - name: Set up Python uses: actions/setup-python@v6 with: