From a014f1be477b07471b1f6acce827adf4b6b59522 Mon Sep 17 00:00:00 2001 From: lukeocodes Date: Fri, 8 May 2026 20:28:32 +0100 Subject: [PATCH] ci(release): switch PyPI watch to JSON API instead of pip index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 'Wait for new deepctl version on PyPI' step in the release workflow polled `pip index versions deepctl`, which queries PyPI's simple index behind a CDN cache that can lag 5-15 minutes after a successful publish. v0.2.21 (PR #3 on homebrew-tap) and v0.2.22 (PR #4 on homebrew-tap) both hit this — PyPI confirmed the release was installable, but the cached simple index hadn't picked it up by the time the 10-minute window (30 × 20s) ran out, so bump-brew-formula failed and we had to re-run the formula bump manually. Switch to GET https://pypi.org/pypi/deepctl//json. That endpoint flips to HTTP 200 the instant a release is published. Same 30 × 20s loop shape, just a different probe — total runtime budget unchanged at 10 minutes worst case but the typical wait should drop to a single iteration. Verified locally that the JSON endpoint already returned 200 for 0.2.22 while `pip index versions` still missed it. No other changes needed — release-please outputs and downstream jobs are untouched. --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9c0cfe9..2dc93e4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -147,8 +147,13 @@ jobs: run: | set -euo pipefail VERSION="${TAG_NAME#v}" + # Poll the PyPI JSON API rather than `pip index versions`. The + # JSON endpoint flips the moment a release is published, while + # the simple index pip queries can lag 5-15 minutes behind a + # successful publish (CDN caching of project metadata). + URL="https://pypi.org/pypi/deepctl/${VERSION}/json" for i in $(seq 1 30); do - if pip index versions deepctl 2>&1 | grep -qE "(^|[^.0-9])${VERSION}([^.0-9]|$)"; then + if [ "$(curl -fsS -o /dev/null -w '%{http_code}' "${URL}")" = "200" ]; then echo "deepctl==${VERSION} is live on PyPI" exit 0 fi