diff --git a/bin/release.sh b/bin/release.sh index 49469a7f..92926003 100755 --- a/bin/release.sh +++ b/bin/release.sh @@ -25,6 +25,18 @@ pypi_release_json() { "https://pypi.org/pypi/${PYPI_PACKAGE}/$1/json?cache_bust=$(date +%s)-${RANDOM}" } +pypi_wait_for_release() { + local version="$1" + pypi_release_json "${version}" >/dev/null + for _ in {1..30}; do + "$CURL_BINARY" -fsSL -H 'Cache-Control: no-cache, no-store, max-age=0' -H 'Pragma: no-cache' \ + "https://pypi.org/simple/${PYPI_PACKAGE}/?cache_bust=$(date +%s)-${RANDOM}" | \ + grep -Fq ">archivebox-${version}-py3-none-any.whl<" && return + sleep 2 + done + return 1 +} + VERSION="$($UV_BINARY run --no-cache --no-project python - <<'PY' from pathlib import Path import json @@ -296,7 +308,7 @@ if [[ "$PYPI_STATE" != complete ]]; then done [[ "${#PYPI_ARTIFACTS[@]}" -gt 0 ]] $UV_BINARY publish --no-cache --trusted-publishing always "${PYPI_ARTIFACTS[@]}" - pypi_release_json "$VERSION" >/dev/null + pypi_wait_for_release "$VERSION" fi if [[ "$IS_RC" == true ]]; then