Skip to content

ci(release): dispatch homebrew + chocolatey auto-update on every release - #2320

Merged
bpamiri merged 1 commit into
developfrom
ci/dispatch-downstream-package-managers
Apr 27, 2026
Merged

bpamiri merged 1 commit into
developfrom
ci/dispatch-downstream-package-managers

Conversation

@bpamiri

@bpamiri bpamiri commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

After the GitHub release artifact upload, fires `repository_dispatch` events of type `wheels-released` to:

Both downstream repos already accept this trigger via companion PRs above (and chocolatey-wheels gains a new `publish-on-merge.yml` that pushes to chocolatey.org once auto-update lands).

This closes a real onboarding latency problem: today, when wheels-dev/wheels publishes a snapshot, Homebrew and Chocolatey users wait up to 24h for the next cron tick before `brew upgrade wheels` / `choco upgrade wheels` does anything useful. With this PR, the chain fires within ~5 minutes.

Setup required

Add a repository secret `DOWNSTREAM_DISPATCH_TOKEN` — a fine-grained PAT (or GitHub App token) with:

  • `metadata: read` on `wheels-dev/homebrew-wheels` and `wheels-dev/chocolatey-wheels`
  • `actions: write` (or equivalently the `repository_dispatch` permission)

If the secret is missing, the step warns and exits 0 — the release itself is never blocked, and cron catches up the next morning.

Security

  • Static event type (`wheels-released`)
  • Fixed repo list (`homebrew-wheels`, `chocolatey-wheels`)
  • `WHEELS_VERSION` is computed earlier in the same workflow from `box.json` + the run number — no user-controlled input
  • The downstream repos' `repository_dispatch` listeners only accept whitelisted event types and don't interpolate `client_payload` into shell

Test plan

  • After merge: confirm `DOWNSTREAM_DISPATCH_TOKEN` is configured on this repo
  • Trigger a snapshot release (push to `develop`) and observe both downstream auto-update workflows starting within ~30s of the snapshot tag appearing
  • Confirm the homebrew auto-update PR opens, lands a formula bump
  • Confirm the chocolatey auto-update PR opens, lands a nuspec bump, and `publish-on-merge` then publishes to chocolatey.org
  • If the secret is missing, the step should warn but not fail (verify by temporarily renaming the secret)

Related

🤖 Generated with Claude Code

Fires `repository_dispatch` events of type `wheels-released` to
wheels-dev/homebrew-wheels and wheels-dev/chocolatey-wheels after the
GitHub release (snapshot or final) is published. Their auto-update
workflows already accept the trigger; this drops the "wheels release
-> package manager bump" latency from up to 24h (cron) to ~5min.

Requires a DOWNSTREAM_DISPATCH_TOKEN secret (fine-grained PAT or app
token with `metadata: read` + `actions: write` on the two downstream
repos). When the secret is missing, the step warns and exits 0 so the
release itself is never blocked — cron picks up.

Static event type and a fixed repo list, no untrusted input flows
into the curl arguments.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bpamiri
bpamiri force-pushed the ci/dispatch-downstream-package-managers branch from 74253dc to bd9d3e7 Compare April 27, 2026 01:08
@bpamiri
bpamiri merged commit c521328 into develop Apr 27, 2026
3 checks passed
@bpamiri
bpamiri deleted the ci/dispatch-downstream-package-managers branch April 27, 2026 01:24
bpamiri added a commit that referenced this pull request Apr 27, 2026
…ml (#2324)

The release.yml workflow runs in two modes:
1. Push to main — secrets are inherited from the workflow run
2. workflow_call from snapshot.yml — secrets must be explicitly declared
   on the callee and explicitly passed through on the caller

#2320 added the dispatch step + read of secrets.DOWNSTREAM_DISPATCH_TOKEN
but only handled mode 1. In mode 2 (which is what snapshot.yml does on
every develop push) the secret is invisible regardless of whether the
repo has it set, so the dispatch step always hits its graceful-degrade
warning branch.

Fix is a 7-line passthrough: declare the secret as optional in the
workflow_call.secrets block of release.yml, then pass it through from
snapshot.yml. Since the step exits 0 when the secret is missing, no
release ever breaks if the secret is unset — this just makes the secret
actually visible when it IS set.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant