From 5584814092bc3a1ca88ab10649fee9dfb51d0383 Mon Sep 17 00:00:00 2001 From: Jaison Reis Date: Wed, 22 Apr 2026 15:23:55 -0300 Subject: [PATCH] ci: notify macwifi-cli when a release is published When Release Please publishes a new GitHub Release for macwifi, fire a repository_dispatch (event type: macwifi-released) at jaisonerick/macwifi-cli with the new version in client_payload.version. The downstream repo listens for this event and auto-bumps its github.com/jaisonerick/macwifi dependency, tags a new patch release, and ships an updated Homebrew formula. The workflow is a no-op if MACWIFI_CLI_DISPATCH_TOKEN is unset, so this can land before the secret is configured without breaking existing release runs. --- .github/workflows/notify-macwifi-cli.yml | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/notify-macwifi-cli.yml diff --git a/.github/workflows/notify-macwifi-cli.yml b/.github/workflows/notify-macwifi-cli.yml new file mode 100644 index 0000000..1aab5db --- /dev/null +++ b/.github/workflows/notify-macwifi-cli.yml @@ -0,0 +1,38 @@ +name: Notify macwifi-cli of new release + +# Fires whenever Release Please publishes a new GitHub Release in this +# repository. The downstream macwifi-cli repo listens for this dispatch +# and auto-bumps its `github.com/jaisonerick/macwifi` dependency, tags +# a new patch release, and ships an updated Homebrew formula. +# +# Required secret: +# MACWIFI_CLI_DISPATCH_TOKEN +# Fine-grained PAT with `contents: read and write` on +# jaisonerick/macwifi-cli. Same PAT can be re-used for the +# downstream MACWIFI_CLI_PUSH_TOKEN and HOMEBREW_TAP_GITHUB_TOKEN +# secrets if its repository scope covers macwifi-cli + homebrew-tap. + +on: + release: + types: [published] + +permissions: + contents: read + +jobs: + dispatch: + runs-on: ubuntu-latest + steps: + - name: Send repository_dispatch to macwifi-cli + env: + GH_TOKEN: ${{ secrets.MACWIFI_CLI_DISPATCH_TOKEN }} + VERSION: ${{ github.event.release.tag_name }} + run: | + if [ -z "$GH_TOKEN" ]; then + echo "::warning::MACWIFI_CLI_DISPATCH_TOKEN is not set; skipping dispatch." + exit 0 + fi + gh api repos/jaisonerick/macwifi-cli/dispatches \ + -X POST \ + -f event_type=macwifi-released \ + -f client_payload[version]="$VERSION"