diff --git a/.github/workflows/bump-homebrew.yml b/.github/workflows/bump-homebrew.yml index def09d1..d6af5c5 100644 --- a/.github/workflows/bump-homebrew.yml +++ b/.github/workflows/bump-homebrew.yml @@ -12,6 +12,11 @@ on: description: "Version to bump to." required: true type: string + dry_run: + description: "Validate the bump without opening a tap PR." + required: false + default: false + type: boolean secrets: TAP_BOT_APP_ID: required: true @@ -24,6 +29,11 @@ on: description: "Version to bump to (e.g. 0.40.0). Defaults to latest on PyPI." required: false type: string + dry_run: + description: "Validate the bump without opening a tap PR." + required: false + default: false + type: boolean permissions: contents: read @@ -119,7 +129,6 @@ jobs: - name: Update url + sha256 and regenerate resources env: - HOMEBREW_NO_INSTALL_FROM_API: "1" HOMEBREW_NO_REQUIRE_TAP_TRUST: "1" SDIST_URL: ${{ steps.sdist.outputs.url }} SDIST_SHA: ${{ steps.sdist.outputs.sha256 }} @@ -174,7 +183,6 @@ jobs: - name: Validate the formula env: - HOMEBREW_NO_INSTALL_FROM_API: "1" HOMEBREW_NO_REQUIRE_TAP_TRUST: "1" run: | set -euo pipefail @@ -182,6 +190,7 @@ jobs: brew audit --formula "${FORMULA}" - name: Open the bump PR + if: ${{ !inputs.dry_run }} env: GH_TOKEN: ${{ steps.app-token.outputs.token }} VERSION: ${{ steps.ver.outputs.version }} diff --git a/tests/test_release_artifacts.py b/tests/test_release_artifacts.py index 5bee45c..66e4005 100644 --- a/tests/test_release_artifacts.py +++ b/tests/test_release_artifacts.py @@ -191,6 +191,7 @@ def test_workflows_separate_automatic_preparation_from_manual_deployment() -> No repository = Path(__file__).resolve().parents[1] ci = (repository / ".github/workflows/ci.yml").read_text(encoding="utf-8") release = (repository / ".github/workflows/release.yml").read_text(encoding="utf-8") + homebrew = (repository / ".github/workflows/bump-homebrew.yml").read_text(encoding="utf-8") prepare = _workflow_job(ci, "prepare-release") draft = _workflow_job(ci, "create-draft-release") @@ -298,6 +299,12 @@ def test_workflows_separate_automatic_preparation_from_manual_deployment() -> No assert release.count("actions/upload-artifact@v7") == 1 assert release.count("actions/download-artifact@v7") == 2 + assert homebrew.count("type: boolean") == 2 + assert 'description: "Validate the bump without opening a tap PR."' in homebrew + assert "HOMEBREW_NO_INSTALL_FROM_API" not in homebrew + assert "if: ${{ !inputs.dry_run }}" in homebrew + assert "brew update-python-resources" in homebrew + assert "pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33" in pypi assert "pypa/gh-action-pypi-publish@release/v1" not in pypi assert "secrets.PYPI_API_TOKEN" in pypi