From 545b656118031783b4c0911370905832d69d748f Mon Sep 17 00:00:00 2001 From: cvanelteren Date: Thu, 13 Aug 2026 15:14:27 +1000 Subject: [PATCH] Only validate release version on non-PR publish builds --- .github/workflows/publish-pypi.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml index 6d820512b..60ace396f 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) @@ -46,7 +54,7 @@ jobs: version=$(python -c "import ultraplot; print(ultraplot.__version__)") echo "Version: $version" - if [[ "$version" == "0."* ]]; then + if [[ "${{ github.event_name }}" != "pull_request" && "$version" == "0."* ]]; then echo "Version is not set correctly!" exit 1 fi