Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .github/workflows/bump-homebrew.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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 }}
Expand Down Expand Up @@ -174,14 +183,14 @@ jobs:

- name: Validate the formula
env:
HOMEBREW_NO_INSTALL_FROM_API: "1"
HOMEBREW_NO_REQUIRE_TAP_TRUST: "1"
run: |
set -euo pipefail
brew style "${FORMULA}"
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 }}
Expand Down
7 changes: 7 additions & 0 deletions tests/test_release_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down
Loading