From 1a416c687e0b8f6164a5093d4c431ff77982b339 Mon Sep 17 00:00:00 2001 From: hongming-codex-laptop Date: Fri, 15 May 2026 13:21:26 -0700 Subject: [PATCH] fix: skip existing runtime autobump tags --- .gitea/workflows/publish-runtime-autobump.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/publish-runtime-autobump.yml b/.gitea/workflows/publish-runtime-autobump.yml index 5bd0814a..619abc6f 100644 --- a/.gitea/workflows/publish-runtime-autobump.yml +++ b/.gitea/workflows/publish-runtime-autobump.yml @@ -113,16 +113,19 @@ jobs: MAJOR=$(echo "$LATEST" | cut -d. -f1) MINOR=$(echo "$LATEST" | cut -d. -f2) PATCH=$(echo "$LATEST" | cut -d. -f3) - VERSION="${MAJOR}.${MINOR}.$((PATCH+1))" - echo "PyPI latest=$LATEST -> next=$VERSION" + PATCH=$((PATCH+1)) + VERSION="${MAJOR}.${MINOR}.${PATCH}" + echo "PyPI latest=$LATEST -> first candidate=$VERSION" + while git tag --list | grep -qx "runtime-v$VERSION"; do + echo "::notice::tag runtime-v$VERSION already exists; trying next patch version" + PATCH=$((PATCH+1)) + VERSION="${MAJOR}.${MINOR}.${PATCH}" + done + echo "selected next free version=$VERSION" if ! echo "$VERSION" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then echo "::error::computed version $VERSION does not match PEP 440 X.Y.Z" exit 1 fi - if git tag --list | grep -qx "runtime-v$VERSION"; then - echo "::error::tag runtime-v$VERSION already exists in this repo. Manual intervention required (PyPI and Gitea tag history are out of sync)." - exit 1 - fi echo "version=$VERSION" >> "$GITHUB_OUTPUT" - name: Push runtime-v$VERSION tag -- 2.52.0