Skip to content

Commit a81a4e3

Browse files
authored
Merge branch 'main' into lelia/ce-359-pin-all-dependencies-in-socket-python-cli
2 parents b316344 + 0b577a9 commit a81a4e3

1 file changed

Lines changed: 21 additions & 7 deletions

File tree

.github/workflows/release.yml

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,17 +79,31 @@ jobs:
7979
env:
8080
VERSION: ${{ env.VERSION }}
8181
run: |
82-
for i in {1..30}; do
83-
if pip install 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 well after a successful upload.
84+
# pip caches HTTP responses by default, so without --no-cache-dir every
85+
# retry can reuse that initial stale response instead of checking whether
86+
# the release has appeared. Budget: 30 minutes.
87+
MAX_ATTEMPTS=60
88+
for i in $(seq 1 "$MAX_ATTEMPTS"); do
89+
if python -m pip install \
90+
--no-cache-dir \
91+
--index-url https://pypi.org/simple/ \
92+
"socketsecurity==${VERSION}"; then
8493
echo "Package ${VERSION} is now available and installable on PyPI"
85-
pip uninstall -y socketsecurity
86-
echo "success=true" >> $GITHUB_OUTPUT
94+
python -m pip uninstall -y socketsecurity
95+
echo "success=true" >> "$GITHUB_OUTPUT"
8796
exit 0
8897
fi
89-
echo "Attempt $i: Package not yet installable, waiting 20s... (${i}/30)"
90-
sleep 20
98+
if curl -s -f "https://pypi.org/pypi/socketsecurity/${VERSION}/json" > /dev/null; then
99+
echo "Release ${VERSION} exists on PyPI (JSON API) but is not in the Simple index yet - CDN propagation delay"
100+
fi
101+
if [ "$i" -lt "$MAX_ATTEMPTS" ]; then
102+
echo "Attempt $i: Package not yet installable, waiting 30s... (${i}/${MAX_ATTEMPTS})"
103+
sleep 30
104+
fi
91105
done
92-
echo "success=false" >> $GITHUB_OUTPUT
106+
echo "success=false" >> "$GITHUB_OUTPUT"
93107
exit 1
94108
95109
- name: Build & Push Docker

0 commit comments

Comments
 (0)