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)