fix: image version in pypi pr workflow (#18735)

This commit is contained in:
Douglas Yang
2026-02-13 00:18:01 +08:00
committed by GitHub
parent 9e9e949261
commit e730c728d3
+8 -7
View File
@@ -34,13 +34,14 @@ jobs:
- name: Generate PR wheel version - name: Generate PR wheel version
id: gen_version id: gen_version
run: | run: |
# Get base version from setuptools_scm # Get base version from the latest v*.*.* git tag directly
cd python # Note: We cannot use setuptools_scm here because the [tool.setuptools_scm]
pip install setuptools-scm # config (with custom git_describe_command) lives in python/pyproject.toml,
FULL_VERSION=$(python -c "from setuptools_scm import get_version; print(get_version(root='..'))") # not at the repo root. Without that config, setuptools_scm falls back to
# Strip any existing .dev or + suffix to get clean base version # default git describe which finds gateway-* tags instead of v*.*.* release tags.
BASE_VERSION=$(echo "$FULL_VERSION" | sed 's/\.dev.*//;s/+.*//') LATEST_TAG=$(git tag --list --sort=-version:refname 'v*.*.*' | head -1)
cd .. BASE_VERSION=${LATEST_TAG#v}
echo "Latest release tag: ${LATEST_TAG}"
# Get commit info # Get commit info
COMMIT_HASH=$(git rev-parse --short HEAD) COMMIT_HASH=$(git rev-parse --short HEAD)