packaging: publish a Homebrew formula on release#5
Merged
Conversation
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.
# Conflicts: # CHANGELOG.md
# Conflicts: # CHANGELOG.md
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 goreleaserbrews:stanza, sobrew install cybertec-postgresql/tap/pg_hardstorageworks on macOS (Apple Silicon) and Linux. No hard PostgreSQL dependency — the optional psql client is surfaced as a caveat.Type
Tests
make checkpasses locally (vet + race tests)make test-integration) where touchedCompatibility
Checklist
Author: Hans-Jürgen Schönig <hs@cybertec.at>)Reviewer / release notes:
to exist before the next tag release; both are now in place.
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.goreleaser release --snapshot --clean --skip=publishdry-run before tagging, since goreleaser couldn't be run in-repo here.