Skip to content

Commit 5fdca35

Browse files
committed
Trigger the tap bump from the tag, not the release
The tap sat on 0.1.1 after v0.2.0 shipped. The job triggered on `release: published`, and the release is created by the release workflow using GITHUB_TOKEN; GitHub does not start workflows from GITHUB_TOKEN events, so it never ran at all. It now triggers on the `v*` tag, like `release` and `publish-pypi` already did, and reads the tag from the ref when it was not dispatched by hand. The formula for 0.2.0 was updated directly in the tap. The second fault stands: HOMEBREW_TAP_TOKEN is unset, so a dispatch skips rather than bumps. Noted in the packaging doc alongside the manual steps.
1 parent 05a9d47 commit 5fdca35

2 files changed

Lines changed: 21 additions & 4 deletions

File tree

‎.github/workflows/bump-tap.yml‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ name: bump-tap
88
# tap repo. Until that exists the job is skipped, not failed, so cutting a
99
# release never blocks on tap plumbing.
1010

11+
# Triggered by the tag, not by `release: published`. A release created by the
12+
# release workflow is created with GITHUB_TOKEN, and GitHub does not start
13+
# workflows from GITHUB_TOKEN events, so the published-release trigger never
14+
# fired. v0.2.0 shipped with the tap still on 0.1.1 because of it.
1115
on:
12-
release:
13-
types: [published]
16+
push:
17+
tags: ["v*"]
1418
workflow_dispatch:
1519
inputs:
1620
tag:
@@ -41,7 +45,7 @@ jobs:
4145
formula-name: agsearch
4246
formula-path: Formula/agsearch.rb
4347
homebrew-tap: devcodes9/homebrew-tap
44-
tag-name: ${{ github.event.inputs.tag || github.event.release.tag_name }}
45-
download-url: https://github.com/devcodes9/agsearch/archive/refs/tags/${{ github.event.inputs.tag || github.event.release.tag_name }}.tar.gz
48+
tag-name: ${{ github.event.inputs.tag || github.ref_name }}
49+
download-url: https://github.com/devcodes9/agsearch/archive/refs/tags/${{ github.event.inputs.tag || github.ref_name }}.tar.gz
4650
env:
4751
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}

‎docs/packaging/homebrew.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,16 @@ parser rather than assumed:
9090
3. **`-n` emits ANSI highlighting even when piped**, so the query string is not
9191
a contiguous substring of the output. The assertions use unhighlighted text
9292
(`billing/config.py`) instead.
93+
94+
## Why v0.2.0 shipped with a stale formula
95+
96+
Two faults, both now fixed in the workflow:
97+
98+
- It triggered on `release: published`. The release is created by the release
99+
workflow using `GITHUB_TOKEN`, and GitHub does not start workflows from
100+
`GITHUB_TOKEN` events, so the job never ran. It triggers on the `v*` tag now,
101+
the same as `release` and `publish-pypi`.
102+
- `HOMEBREW_TAP_TOKEN` is still not set, so a manual dispatch skipped rather than
103+
bumped. Until that secret exists, a release needs the formula updated by hand:
104+
point `url` at the new tag and replace `sha256` with
105+
`shasum -a 256` of that tarball.

0 commit comments

Comments
 (0)