fix: bumping nightly whl version (#18212)

This commit is contained in:
Douglas Yang
2026-02-03 20:43:38 -08:00
committed by GitHub
parent 37c33cc0aa
commit b7c1dfc602

View File

@@ -63,8 +63,17 @@ jobs:
if [ "$DIST" = "0" ]; then
TAG=$(echo "$DESC" | cut -d- -f1)
HASH="g$(git rev-parse --short HEAD)"
FORCE_VERSION="${TAG#v}.dev0+${HASH}"
echo "Building at exact tag, forcing version to: $FORCE_VERSION"
# Increment patch version for nightlies (e.g., v0.5.8 -> 0.5.9.dev0)
VERSION=${TAG#v} # Remove 'v' prefix
MAJOR=$(echo "$VERSION" | cut -d. -f1)
MINOR=$(echo "$VERSION" | cut -d. -f2)
PATCH=$(echo "$VERSION" | cut -d. -f3)
NEXT_PATCH=$((PATCH + 1))
NEXT_VERSION="${MAJOR}.${MINOR}.${NEXT_PATCH}"
FORCE_VERSION="${NEXT_VERSION}.dev0+${HASH}"
echo "Building at exact tag $TAG, forcing nightly version to: $FORCE_VERSION"
export SETUPTOOLS_SCM_PRETEND_VERSION="$FORCE_VERSION"
fi