Skip to content

packaging: publish a Homebrew formula on release#5

Merged
postgresql007 merged 4 commits into
mainfrom
homebrew-tap
Jun 22, 2026
Merged

packaging: publish a Homebrew formula on release#5
postgresql007 merged 4 commits into
mainfrom
homebrew-tap

Conversation

@cybertec-adrian

Copy link
Copy Markdown
Contributor

Add a brews: stanza to .goreleaser.yaml so each release generates and pushes Formula/pg_hardstorage.rb to the org-wide tap (cybertec-postgresql/homebrew-tap), making 'brew install cybertec-postgresql/tap/pg_hardstorage' work on macOS (Apple Silicon) and Linux (amd64/arm64).

No hard PostgreSQL dependency: the agent talks to PostgreSQL over the replication protocol (often a remote DB), so a forced local server build on install would be wrong - the optional psql client is surfaced as a caveat instead.

The formula push targets a second repo, which the default GITHUB_TOKEN can't write, so release.yml passes a dedicated HOMEBREW_TAP_TOKEN (fine-grained PAT, contents:write on homebrew-tap only) through to goreleaser.

Summary

Publish a Homebrew formula to the org-wide tap (cybertec-postgresql/homebrew-tap) on each release via a goreleaser brews: stanza, so brew install cybertec-postgresql/tap/pg_hardstorage works on macOS (Apple Silicon) and Linux. No hard PostgreSQL dependency — the optional psql client is surfaced as a caveat.

Type

  • Bug fix
  • New feature
  • Refactor (no behaviour change)
  • Documentation
  • Test infrastructure
  • Packaging / release

Tests

  • make check passes locally (vet + race tests)
  • New tests added for the changed behaviour, or there's a clear reason none exist
  • Integration tests pass (make test-integration) where touched

Compatibility

  • No on-disk manifest schema changes (or: schema bumped + 24-month back-read preserved)
  • No CLI / API contract changes (or: documented + bumped)
  • No new external dependencies (or: justified in the description)

Checklist

  • Maintainer-attribution authoring (Author: Hans-Jürgen Schönig <hs@cybertec.at>)
  • No AI-attribution lines anywhere
  • CHANGELOG.md updated under the unreleased section
  • Comments explain WHY (not WHAT) where the code isn't self-evident

Reviewer / release notes:

  • Requires the homebrew-tap repo (public) + HOMEBREW_TAP_TOKEN secret
    to exist before the next tag release; both are now in place.
  • The formula push happens on the next v* tag. Since v1.0.0 already
    shipped, cut a patch tag (e.g. v1.0.1) to populate the tap the first
    time, then test brew install cybertec-postgresql/tap/pg_hardstorage.
  • Recommend a goreleaser release --snapshot --clean --skip=publish
    dry-run before tagging, since goreleaser couldn't be run in-repo here.

Add a brews: stanza to .goreleaser.yaml so each release generates and pushes Formula/pg_hardstorage.rb to the org-wide tap (cybertec-postgresql/homebrew-tap), making 'brew install cybertec-postgresql/tap/pg_hardstorage' work on macOS (Apple Silicon) and Linux (amd64/arm64).

No hard PostgreSQL dependency: the agent talks to PostgreSQL over the replication protocol (often a remote DB), so a forced local server build on install would be wrong - the optional psql client is surfaced as a caveat instead.

The formula push targets a second repo, which the default GITHUB_TOKEN can't write, so release.yml passes a dedicated HOMEBREW_TAP_TOKEN (fine-grained PAT, contents:write on homebrew-tap only) through to goreleaser.
The repo builds two archives per OS/arch (pg_hardstorage and
pg_hardstorage_testkit). Without an ids filter the brews stanza pulls in
both, yielding an ambiguous/incorrect formula. Pin ids: [pg_hardstorage]
(mirroring nfpms.ids) so only the CLI archive is published. Verified
with a snapshot build: formula resolves darwin/arm64 + linux/amd64,arm64
to the pg_hardstorage tarballs only.
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.

2 participants