From 74beefa96ae2ef30073fa7f10a7ddde7415b1827 Mon Sep 17 00:00:00 2001 From: Dinakar Sarbada Date: Mon, 4 May 2026 01:04:27 -0700 Subject: [PATCH] docs: integrate Homebrew tap update into release flow Co-authored-by: Dinakar Sarbada --- CHANGELOG.md | 3 +++ docs/RELEASING.md | 5 ++-- scripts/update-homebrew.sh | 50 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100755 scripts/update-homebrew.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 33fff0e..56cda1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Unreleased +- Add a release helper for Homebrew tap updates; thanks @dinakars777. + ## 0.2.0 - 2026-05-04 - Add location-based reminder triggers via `--location`, `--leaving`, and `--radius` - Add simple recurrence support via `--repeat` and `--no-repeat` diff --git a/docs/RELEASING.md b/docs/RELEASING.md index 67aa7ea..8e9c019 100644 --- a/docs/RELEASING.md +++ b/docs/RELEASING.md @@ -30,8 +30,9 @@ ```sh gh release create v0.2.0 /tmp/remindctl-macos.zip -t "v0.2.0" -F /tmp/release-notes.txt ``` -5. Homebrew tap - - Update `../homebrew-tap/Formula/remindctl.rb` to point at the GitHub release asset. +5. Update Homebrew tap + - Run `scripts/update-homebrew.sh vX.Y.Z` to trigger and watch the centralized formula updater. + - Requires a GitHub token with workflow dispatch access to `steipete/homebrew-tap`. ## What happens in CI - Release signing + notarization are done locally via `scripts/sign-and-notarize.sh`. diff --git a/scripts/update-homebrew.sh b/scripts/update-homebrew.sh new file mode 100755 index 0000000..ea49531 --- /dev/null +++ b/scripts/update-homebrew.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +TAG="$1" +TAP_REPO="steipete/homebrew-tap" +WORKFLOW="update-formula.yml" +SAFE_TAG=$(printf '%s' "$TAG" | tr -c 'A-Za-z0-9._-' '-') +REQUEST_ID="remindctl-${SAFE_TAG}-$(date -u +%Y%m%dT%H%M%SZ)-$$" + +gh workflow run "$WORKFLOW" \ + --repo "$TAP_REPO" \ + --ref main \ + -f formula=remindctl \ + -f tag="$TAG" \ + -f repository=steipete/remindctl \ + -f macos_artifact="remindctl-macos.zip" \ + -f request_id="$REQUEST_ID" + +echo "Homebrew tap update dispatched: $REQUEST_ID" + +RUN_ID="" +for _ in {1..30}; do + RUN_ID=$(gh run list \ + --repo "$TAP_REPO" \ + --workflow "$WORKFLOW" \ + --branch main \ + --limit 20 \ + --json databaseId,displayTitle \ + --jq ".[] | select(.displayTitle | contains(\"($REQUEST_ID)\")) | .databaseId" \ + | head -n 1) + + if [[ -n "$RUN_ID" ]]; then + break + fi + + sleep 2 +done + +if [[ -z "$RUN_ID" ]]; then + echo "Timed out waiting for Homebrew tap workflow run: $REQUEST_ID" >&2 + echo "Monitor: https://github.com/$TAP_REPO/actions/workflows/$WORKFLOW" >&2 + exit 1 +fi + +gh run watch "$RUN_ID" --repo "$TAP_REPO" --exit-status