diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91061d6b..b8932965 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -138,12 +138,20 @@ jobs: shell: bash run: | set -Eeuo pipefail - sleep 60 VERSION='${{ steps.version.outputs.version }}' TOOL_ROOT="$(mktemp -d)" export UV_TOOL_DIR="$TOOL_ROOT/tools" export UV_TOOL_BIN_DIR="$TOOL_ROOT/bin" - "$UV_BINARY" tool install --no-cache --prerelease allow --force "archivebox==$VERSION" + for attempt in {1..40}; do + if "$UV_BINARY" tool install --no-cache --prerelease allow --force "archivebox==$VERSION"; then + break + fi + if [[ "$attempt" == 40 ]]; then + echo "archivebox==$VERSION did not become installable from PyPI within 10 minutes" >&2 + exit 1 + fi + sleep 15 + done INSTALLED_VERSION="$("$UV_TOOL_BIN_DIR/archivebox" --version)" test "$INSTALLED_VERSION" = "$VERSION" diff --git a/archivebox/tests/test_release_workflow.py b/archivebox/tests/test_release_workflow.py index 8ee0cd32..176b19c5 100644 --- a/archivebox/tests/test_release_workflow.py +++ b/archivebox/tests/test_release_workflow.py @@ -22,6 +22,15 @@ def test_release_uses_registered_publisher_and_authorized_tag_credentials(): assert checkout["with"]["token"] == "${{ secrets.RELEASE_GH_TOKEN || github.token }}" assert docker_release["needs"] == "python-release" + published_install = next( + step for step in python_release["steps"] if step.get("name") == "Verify published PyPI package installs and runs" + ) + install_script = published_install["run"] + assert "sleep 60" not in install_script + assert "for attempt in {1..40}" in install_script + assert 'tool install --no-cache --prerelease allow --force "archivebox==$VERSION"' in install_script + assert "did not become installable from PyPI within 10 minutes" in install_script + docker_meta = next(step for step in docker_release["steps"] if step.get("id") == "docker_meta") tag_script = docker_meta["run"] assert 'echo "${DOCKERHUB_IMAGE}:dev"' in tag_script