From e730c728d33532d8674105b9b2fc12163d5ed909 Mon Sep 17 00:00:00 2001 From: Douglas Yang Date: Thu, 12 Feb 2026 08:18:01 -0800 Subject: [PATCH] fix: image version in pypi pr workflow (#18735) --- .github/workflows/release-pypi-pr.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-pypi-pr.yml b/.github/workflows/release-pypi-pr.yml index 93d704736..d14be109f 100644 --- a/.github/workflows/release-pypi-pr.yml +++ b/.github/workflows/release-pypi-pr.yml @@ -34,13 +34,14 @@ jobs: - name: Generate PR wheel version id: gen_version run: | - # Get base version from setuptools_scm - cd python - pip install setuptools-scm - FULL_VERSION=$(python -c "from setuptools_scm import get_version; print(get_version(root='..'))") - # Strip any existing .dev or + suffix to get clean base version - BASE_VERSION=$(echo "$FULL_VERSION" | sed 's/\.dev.*//;s/+.*//') - cd .. + # Get base version from the latest v*.*.* git tag directly + # Note: We cannot use setuptools_scm here because the [tool.setuptools_scm] + # config (with custom git_describe_command) lives in python/pyproject.toml, + # not at the repo root. Without that config, setuptools_scm falls back to + # default git describe which finds gateway-* tags instead of v*.*.* release tags. + LATEST_TAG=$(git tag --list --sort=-version:refname 'v*.*.*' | head -1) + BASE_VERSION=${LATEST_TAG#v} + echo "Latest release tag: ${LATEST_TAG}" # Get commit info COMMIT_HASH=$(git rev-parse --short HEAD)