From b3b286694d82d236ee9b224376ec7abd5ee30de6 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Fri, 28 Aug 2026 12:40:54 -0700 Subject: [PATCH] Speed release image pipeline [skip ci] --- .github/workflows/ci.yml | 9 ++++- .github/workflows/deploy-publicsite.yml | 1 + .github/workflows/docker.yml | 4 ++ .github/workflows/pip.yml | 49 ++++++++--------------- archivebox/tests/test_release_workflow.py | 3 +- 5 files changed, 30 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3ad14b8..24b5610a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,36 +19,43 @@ concurrency: jobs: lint: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: Linters uses: ./.github/workflows/lint.yml secrets: inherit install-cli-platform: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: Install and CLI platform compatibility uses: ./.github/workflows/test.yml secrets: inherit tests: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: Discovered test matrix uses: ./.github/workflows/test-parallel.yml secrets: inherit documentation: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: Documentation and root tests uses: ./.github/workflows/docs.yml secrets: inherit codeql: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: CodeQL uses: ./.github/workflows/codeql.yml secrets: inherit python-artifacts: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: Tested Python artifacts uses: ./.github/workflows/pip.yml secrets: inherit docker-digests: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' name: Tested Docker images uses: ./.github/workflows/docker.yml with: @@ -57,7 +64,7 @@ jobs: required: name: All required CI lanes - if: ${{ always() }} + if: ${{ always() && (github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io') }} needs: - lint - install-cli-platform diff --git a/.github/workflows/deploy-publicsite.yml b/.github/workflows/deploy-publicsite.yml index f46d1fe6..5fcc78ca 100644 --- a/.github/workflows/deploy-publicsite.yml +++ b/.github/workflows/deploy-publicsite.yml @@ -27,6 +27,7 @@ concurrency: jobs: deploy: + if: github.event_name != 'push' || github.event.head_commit.author.email != 'release-bot@archivebox.io' environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0e7bca5d..563243d9 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -207,6 +207,8 @@ jobs: ARCHIVEBOX_COMMIT_HASH=${{ github.sha }} pull: true platforms: ${{ matrix.platform }} + cache-from: type=gha,scope=${{ matrix.cache_scope }} + cache-to: type=gha,mode=max,scope=${{ matrix.cache_scope }} outputs: | type=docker,name=${{ matrix.local_tag }} type=oci,dest=${{ runner.temp }}/archivebox-image.tar @@ -227,6 +229,8 @@ jobs: ARCHIVEBOX_COMMIT_HASH=${{ github.sha }} pull: true platforms: ${{ matrix.platform }} + cache-from: type=gha,scope=${{ matrix.cache_scope }} + cache-to: type=gha,mode=max,scope=${{ matrix.cache_scope }} - name: Image digest if: inputs.push_digests diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index a8c07767..1dbf10c7 100755 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -64,6 +64,22 @@ jobs: Path("dist/SHA256SUMS").write_text("\n".join(checksum_lines) + "\n") PY + - name: Release wheel import and CLI smoke + if: ${{ !inputs.full_tests }} + shell: bash + run: | + set -Eeuo pipefail + shopt -s nullglob + wheels=(dist/archivebox-*.whl) + [[ "${#wheels[@]}" -eq 1 ]] + smoke_env="$(mktemp -d)/.venv" + uv venv --python 3.13 "$smoke_env" + uv pip install --no-cache --python "$smoke_env" "${wheels[0]}" + unset PYTHONPATH + cd "$(mktemp -d)" + VIRTUAL_ENV="$smoke_env" uv run --no-cache --active --no-project --no-sync python -c 'import archivebox' + VIRTUAL_ENV="$smoke_env" uv run --no-cache --active --no-project --no-sync archivebox version + - name: Upload every distribution uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: @@ -226,36 +242,3 @@ jobs: fi sudo rm -rf "$root_tool_dir" fi - - release-smoke: - name: Release wheel import and CLI smoke - if: ${{ !inputs.full_tests }} - needs: build - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - - - uses: astral-sh/setup-uv@d0cc045d04ccac9d8b7881df0226f9e82c39688e # v6 - with: - version: ${{ env.UV_VERSION }} - enable-cache: false - - - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 - with: - name: python-distributions - path: ${{ runner.temp }}/python-distributions - - - name: Install the wheel and verify import and CLI version - shell: bash - run: | - set -Eeuo pipefail - shopt -s nullglob - wheels=("$RUNNER_TEMP"/python-distributions/archivebox-*.whl) - [[ "${#wheels[@]}" -eq 1 ]] - smoke_env="$(mktemp -d)/.venv" - uv venv --python 3.13 "$smoke_env" - uv pip install --no-cache --python "$smoke_env" "${wheels[0]}" - unset PYTHONPATH - cd "$(mktemp -d)" - VIRTUAL_ENV="$smoke_env" uv run --no-cache --active --no-project --no-sync python -c 'import archivebox' - VIRTUAL_ENV="$smoke_env" uv run --no-cache --active --no-project --no-sync archivebox version diff --git a/archivebox/tests/test_release_workflow.py b/archivebox/tests/test_release_workflow.py index 27552034..b14ff3c7 100644 --- a/archivebox/tests/test_release_workflow.py +++ b/archivebox/tests/test_release_workflow.py @@ -30,9 +30,8 @@ def test_release_uses_registered_publisher_and_authorized_tag_credentials(): candidate = yaml.safe_load(RELEASE_CANDIDATE_WORKFLOW.read_text()) assert candidate["jobs"]["python-artifacts"]["with"]["full_tests"] is False pip_workflow = yaml.safe_load(PIP_WORKFLOW.read_text()) - release_smoke = pip_workflow["jobs"]["release-smoke"] install_script = next( - step["run"] for step in release_smoke["steps"] if step.get("name") == "Install the wheel and verify import and CLI version" + step["run"] for step in pip_workflow["jobs"]["build"]["steps"] if step.get("name") == "Release wheel import and CLI smoke" ) assert "uv pip install --no-cache" in install_script assert "import archivebox" in install_script