From cdd02ab3f4e972617f0c791daf5227c02d9d1170 Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Thu, 13 Aug 2026 15:04:59 +1000 Subject: [PATCH] Fix release build versioning from Git tags --- .github/workflows/publish-pypi.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 6d820512b..643b0a020 100644 --- a/.github/workflows/publish-pypi.yml +++ b/.github/workflows/publish-pypi.yml @@ -22,6 +22,14 @@ jobs: with: python-version: "3.12" + - name: Pin version from tag on release builds + if: startsWith(github.ref, 'refs/tags/') + run: | + VERSION="${GITHUB_REF_NAME#v}" + echo "Using tagged version: $VERSION" + echo "SETUPTOOLS_SCM_PRETEND_VERSION=$VERSION" >> "$GITHUB_ENV" + shell: bash + - name: Ensure clean tree before build run: | git diff --quiet || (git status --short && git diff && exit 1)