Publish pre-built binaries and packages with each release - #55
Conversation
|
Is there a good way to test this without merging and tagging? I've found I always need to iterate a little on GHA and it creates a lot of clutter in the build pipeline/tags/commits. Maybe cloning the repo, merging there and testing, then pull any changes back into this PR? |
Pushing a vX.Y.Z tag builds macOS, Linux and Windows on x86-64 and arm64, attaches the archives, .debs and SHA256SUMS to the release, and regenerates the Homebrew tap formula. macOS builds run natively per arch because macho-align.sh repacks libtile57.a for the host only. Linux uses -gnu targets so libtile57.a stays glibc-linkable while build.zig retargets the CLI to static musl.
A fork testing the workflow pushes its formula to its own tap and points the downloads at its own release, instead of writing to the upstream org.
0838b67 to
bf0a770
Compare
|
Ran this on my fork. Action run: https://github.com/openwatersio/tile57/actions/runs/32174366290/job/95834675883 |
There was a problem hiding this comment.
Pull request overview
Adds an automated release pipeline so pushing a vX.Y.Z tag produces versioned, downloadable build artifacts (archives for multiple OS/arch targets, .deb packages, checksums, and a Homebrew formula update), aligning distribution with tile57’s “bake once, render/compose many” packaging story.
Changes:
- Introduces a GitHub Actions tag-triggered release workflow to build, package, checksum, and publish release assets (and update the Homebrew tap on non-prerelease tags).
- Adds release packaging scripts for staging archives/
.deband generating a Homebrew formula from freshly-built checksums. - Updates docs/README to lead with binary installation options and documents release-cutting steps.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/release.yml |
Tag-triggered workflow that builds a target matrix, publishes release assets + SHA256SUMS, and updates a Homebrew tap for non-prereleases. |
scripts/package-release.sh |
Stages zig-out outputs into per-target archives and optionally builds .deb packages. |
scripts/brew-formula.sh |
Generates a Homebrew formula by computing sha256 for the just-built archives. |
README.md |
Updates “Start here” to prefer Homebrew / Releases and summarizes new distribution options. |
docs/docs/installation.md |
Reworks installation docs to include Releases, .deb, Homebrew, and updated Zig fetch guidance. |
docs/docs/zig-api.md |
Updates Zig package consumption guidance to use zig fetch --save for tagged tarballs. |
docs/docs/contributing.md |
Documents release procedure and version/tag consistency requirements. |
.gitignore |
Ignores /dist/ created by the new release packaging scripts. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Debian reads 0.4.0-rc1 as revision rc1 of 0.4.0, which sorts after the final release and blocks the upgrade as a downgrade. Use 0.4.0~rc1. Also names the archive placeholder as the Zig target triple it is, and points the quarantine command at the extracted directory.
|
LGTM, if you have no further changes I'll merge it. I've already setup the homebrew-tap repository. Thanks again for this PR! |
|
Should be good to go! |
This adds a release workflow so that pushing a
vX.Y.Ztag produces downloadable binaries for macOS, Linux and Windows on both architectures, plus a Homebrew formula and a.deb.Adding a tag via
git tag v0.4.0 && git push origin v0.4.0or the GitHub Releases UI runs .github/workflows/release.yml, which:ReleaseFastfor six targets and packages each one astile57-<version>-<arch>-<os>.tar.gz, or.zipon Windows, carryingbin/tile57,lib/libtile57.a,include/tile57.h, and the licenses.tile57_<version>_{amd64,arm64}.debfrom the same payload.--generate-notes, all the archives, and aSHA256SUMSfile.Formula/tile57.rbin the Homebrew tap and pushes it.A tag carrying a suffix,
v0.4.0-rc1, publishes as a prerelease and skips the tap, so the whole matrix can be exercised without shipping anything.Before any of that, each build leg checks the tag against the version in
build.zig.zon,src/tile57.zigandtools/common.zig. A mismatch fails the build rather than shipping a binary whosetile57 versioncontradicts the file it arrived in.Two target choices
macOS builds run natively per arch instead of cross-compiling from one runner.
scripts/macho-align.shcallsld -randlibtoolwithout-arch, so it can only repacklibtile57.afor the host. Threading the target arch through that script would allow a single-runner build, but native runners cost no code. That threading is the fix if themacos-15-intelrunner is ever retired.Linux uses the
-gnutargets rather than-musl.build.zigalready retargets the CLI to static musl on a glibc host, so the-gnuarchives carry a portabletile57and alibtile57.athat a glibc C host can still link. Building-muslwould give up the second half of that.Packages
Homebrew covers macOS and Linux from one formula, generated by
scripts/brew-formula.shout of the checksums of the archives that were just built. The formula installs the binary, the static library and the header, and itstest doblock runstile57 version. Generating it beats hand-editing because all four checksums change every release. It does need a tap repo and a token, which is the checklist below.The
.debis a release asset, not an apt repository.sudo apt install ./tile57_0.4.0_amd64.debworks,apt install tile57does not. A real repository needs a signing key in secrets and somewhere to host the index, which seemed worth deferring until someone asks for it. Scoop, winget and AUR are out for the same reason.Docs
Installation leads with binaries and keeps building from source below them. Its note about
zig fetchbeing broken is gone:.pathsinbuild.zig.zoncoversvendor/,include/andtools/, and I confirmed that a fetched package buildslibtile57.awith no submodules initialised, so the lazys101_portrayaldependency is doing its job. The same stale note in Zig API is replaced with thezig fetch --saveline. Contributing gains the release steps.Tested
The
.debwas built and inspected withdpkg-deb, so root ownership, the control fields, and the layout under/usrare all confirmed. Tarball layout checked. Formula generation checked, including its non-zero exit when an archive is missing.actionlintandshellcheckare clean, and azig fetched package built tolibtile57.awithout submodules.The macOS legs are the untested part. CI has never built Darwin, so an
-rc1tag should come before the real one.TODO
Before the first tag:
beetlebugorg/homebrew-tap. Public, and empty is fine, since the workflow createsFormula/: https://github.com/newcontents: writeon that repository, either a fine-grained PAT scoped to it or a GitHub App installation token: https://github.com/settings/personal-access-tokensHOMEBREW_TAP_TOKEN: https://github.com/beetlebugorg/tile57/settings/secrets/actionsWithout the secret the tap step logs a warning and exits, and the release still publishes.
First release:
v0.3.0-rc1and confirm all six build legs go green, especially the two macOS ones..deband check they run on a clean machine.brew install beetlebugorg/tap/tile57on macOS and on Linux.docs/docs/installation.md.Not in this PR, worth considering later:
xattr -d com.apple.quarantine. Needs an Apple Developer account and certificates in secrets.apt install tile57is wanted.macos-latesttoci.ymlso Darwin breakage surfaces on PRs instead of at tag time.