ci: add goreleaser-driven release pipeline - #4
Open
kpeluso wants to merge 1 commit into
Open
Conversation
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.
Symptom
Downstream integrators installing veto on EC2 / CI hosts have to clone
the source repo and run
make install(which gates ongo test -race).That adds 30–90s of cold-boot latency to every install and requires Go,
gcc, make, and build-essential to be pre-installed on the host. The
releases page on GitHub is empty — there is no curl-installable binary
for an integrator to fetch.
Implementation
Adds a goreleaser-driven release pipeline:
.goreleaser.yaml(v2 schema). Pure-Go builds (CGO_ENABLED=0)for
{linux,darwin} x {amd64,arm64}.-trimpath,-s -w, plus-X main.{version,commit,buildDate}=…ldflags that become meaningfulthe moment a separate PR (
--versionflag) lands those vars incmd/veto/main.go(Go's linker silently ignores-Xagainstundefined symbols until then). Tarball archives named
veto_<ver>_<os>_<arch>.tar.gzship the binary plusREADME.md.checksums.txt(SHA256) sits alongside.go generate ./internal/interposer/gen/...runs in the before-hookso
pm_names.his in sync with the canonical Go PM list at releasetime (matters for a separate pending PR that
go:embedsveto_interpose.c)..github/workflows/release.yml. Singleubuntu-latestrunner, fireson
v*.*.*tag pushes.actions/checkout@v4withfetch-depth: 0(goreleaser needs full history),actions/setup-go@v5pinned to Go 1.26.2 with module cache, then
goreleaser/goreleaser-action@v6runningrelease --clean.permissions: contents: writelets the defaultGITHUB_TOKENupload release assets.
latest release (with
jq+uname-based OS/arch detection) anddocuments
make installas a "From source" fallback under"Installation Details".
CGO stays disabled because the C interposer is not cgo-linked into
veto; pending embed work
go:embedsveto_interpose.cand builds itat install time on the user's host. The release workflow does not need
to ship per-arch
.so/.dylibfiles.Verification
Smoke-tested locally with goreleaser 2.16.0 on darwin/arm64:
goreleaser checkvalidates the config cleanly.goreleaser release --snapshot --clean --skip=publishbuilds allfour targets and emits four tarballs plus
checksums.txtin 9s.tar -tzf dist/veto_0.0.1-snapshot_linux_amd64.tar.gzlistsREADME.mdandveto— the expected payload.Activation notes
This workflow does nothing until the maintainer pushes a
v*.*.*tag. The first release is a manual step on the maintainer's side:
The push triggers
release.yml, which cross-compiles all four targets,uploads the tarballs +
checksums.txt, and creates the GitHub release.Subsequent releases need only another tag push.
Out of scope
LICENSE*glob intentionally dropped from thearchive
files:list — currently onlyREADME.mdis included).