Skip to content

Commit 0be8234

Browse files
leliaclaude
andcommitted
Align release verify step with socket-sdk-python hardening
Use python -m pip with an explicit production Simple-index URL, quote workflow outputs, and skip the sleep after the final attempt, matching the socket-sdk-python release workflow so the verify step is identical in both repos. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: lelia <2418071+lelia@users.noreply.github.com>
1 parent 0b18da5 commit 0be8234

1 file changed

Lines changed: 20 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,25 +79,32 @@ jobs:
7979
env:
8080
VERSION: ${{ env.VERSION }}
8181
run: |
82-
# PyPI's simple index is CDN-cached and can lag a successful upload
83-
# by 10+ minutes when a cache purge is delayed (both socketsecurity
84-
# 2.5.9 and socketdev 3.4.2 hit this on 2026-08-05), so retry for up
85-
# to 30 minutes and use --no-cache-dir so each attempt refetches the
86-
# index instead of revalidating a stale copy from pip's HTTP cache.
87-
for i in {1..60}; do
88-
if pip install --no-cache-dir socketsecurity==${VERSION}; then
82+
# The first lookup can race PyPI's Simple-index propagation, and a delayed
83+
# CDN purge can leave the index stale for 10+ minutes after a successful
84+
# upload (socketsecurity 2.5.9 and socketdev 3.4.2 both hit this on
85+
# 2026-08-05). pip caches HTTP responses by default, so without
86+
# --no-cache-dir every retry can reuse that initial stale response instead
87+
# of checking whether the release has appeared. Budget: 30 minutes.
88+
MAX_ATTEMPTS=60
89+
for i in $(seq 1 "$MAX_ATTEMPTS"); do
90+
if python -m pip install \
91+
--no-cache-dir \
92+
--index-url https://pypi.org/simple/ \
93+
"socketsecurity==${VERSION}"; then
8994
echo "Package ${VERSION} is now available and installable on PyPI"
90-
pip uninstall -y socketsecurity
91-
echo "success=true" >> $GITHUB_OUTPUT
95+
python -m pip uninstall -y socketsecurity
96+
echo "success=true" >> "$GITHUB_OUTPUT"
9297
exit 0
9398
fi
9499
if curl -s -f "https://pypi.org/pypi/socketsecurity/${VERSION}/json" > /dev/null; then
95-
echo "Release ${VERSION} exists on PyPI (JSON API) but is not in the simple index yet - CDN propagation delay"
100+
echo "Release ${VERSION} exists on PyPI (JSON API) but is not in the Simple index yet - CDN propagation delay"
101+
fi
102+
if [ "$i" -lt "$MAX_ATTEMPTS" ]; then
103+
echo "Attempt $i: Package not yet installable, waiting 30s... (${i}/${MAX_ATTEMPTS})"
104+
sleep 30
96105
fi
97-
echo "Attempt $i: Package not yet installable, waiting 30s... (${i}/60)"
98-
sleep 30
99106
done
100-
echo "success=false" >> $GITHUB_OUTPUT
107+
echo "success=false" >> "$GITHUB_OUTPUT"
101108
exit 1
102109
103110
- name: Build & Push Docker

0 commit comments

Comments
 (0)