Skip to content

Commit 5b12b60

Browse files
mavamclaude
andcommitted
Poll PyPI API for version availability before verification
Replace fixed 30-second sleep with a retry loop that polls the PyPI API every 5 seconds until the expected version appears. This handles CDN propagation delays gracefully instead of failing on slow updates. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cfdb1be commit 5b12b60

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

.github/workflows/publish.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,6 @@ jobs:
7777
- name: Install uv
7878
uses: astral-sh/setup-uv@v4
7979

80-
- name: Wait for package availability
81-
run: sleep 30
82-
8380
- name: Determine expected version
8481
id: expected-version
8582
run: |
@@ -92,6 +89,23 @@ jobs:
9289
echo "expected_tag=$tag" >> "$GITHUB_OUTPUT"
9390
echo "expected_version=$version" >> "$GITHUB_OUTPUT"
9491
92+
- name: Wait for package availability
93+
env:
94+
EXPECTED_VERSION: ${{ steps.expected-version.outputs.expected_version }}
95+
run: |
96+
echo "Waiting for version $EXPECTED_VERSION to appear on PyPI..."
97+
for i in {1..30}; do
98+
version=$(curl -sf https://pypi.org/pypi/tenzir-ship/json | jq -r '.info.version' || echo "")
99+
if [ "$version" = "$EXPECTED_VERSION" ]; then
100+
echo "Version $EXPECTED_VERSION is now available on PyPI"
101+
exit 0
102+
fi
103+
echo "Attempt $i: found version '$version', waiting 5s..."
104+
sleep 5
105+
done
106+
echo "Timeout waiting for version $EXPECTED_VERSION on PyPI" >&2
107+
exit 1
108+
95109
- name: Verify published version
96110
env:
97111
EXPECTED_VERSION: ${{ steps.expected-version.outputs.expected_version }}

0 commit comments

Comments
 (0)