Skip to content

ci(release): one runner per target, reuse build.yaml's warm caches - #961

Merged
u9g merged 2 commits into
mainfrom
jason/release-matrix
Sep 3, 2026
Merged

ci(release): one runner per target, reuse build.yaml's warm caches#961
u9g merged 2 commits into
mainfrom
jason/release-matrix

Conversation

@u9g

@u9g u9g commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The Release job for v2.18.5 took 39 minutes, 36m43s of it in Run GoReleaser. v2.18.4 and v2.18.3 look the same, so this is not a regression: #951 moved the PR/main Build workflow to one runner per zig target with per-target GOCACHE caches, but release.yaml kept the pre-#951 shape:

  • one macos-latest runner (3 vCPU) compiling darwin plus all four zig cross targets in a single goreleaser run; the cross targets took 11 to 22 minutes each, two at a time, while both darwin builds finished in ~2 minutes
  • setup-go's default cache (cache: true), whose key is only OS/arch/Go version/go.sum and so collides with the Go Test workflow's macOS leg. Test claims the key first with native -race objects, actions/cache never overwrites on a hit, and the release restored 702 MB of objects no zig target could use, every release. This is the same collision build.yaml already documents and opts out of.

The warm cache does work for zig targets once it actually contains their objects. Build runs on main since #951: 267s to 401s per target on the first (cold) run, 22s to 60s on every run since, including the 712b1f7 run that preceded this tag.

Change

  • build job: a matrix of the four zig targets on ubuntu-latest plus lk-darwin on macos-latest, each running goreleaser build --id <target>. The GOCACHE and .cross cache keys and paths are identical to build.yaml's so the tag build restores what the push to main just saved (caches on the default branch are readable from tag refs). No new cache footprint, which matters because the repo's Actions cache sits at 9.8 GB of the 10 GB quota.
  • goreleaser OSS has no prebuilt builder or --split, so each job archives its own binaries in the layout goreleaser release produced (lk_<version>_<os>_<arch>.tar.gz / .zip with LICENSE, autocomplete/ and the binary at the root), and a final release job writes checksums.txt (same sha256sum format) and runs gh release create --draft --generate-notes, with --prerelease when the tag has a prerelease suffix. Published releases already use GitHub's generated notes, so the body format is unchanged.
  • The docker job extracts the linux binaries from the linux archives instead of a separate artifact.
  • The two identical darwin build IDs are merged into one lk-darwin id (separate commit) so one macOS job builds both arches. build.yaml's darwin cache key is renamed to go-<os>-lk-darwin- so both workflows share it.

Verified locally: goreleaser check, goreleaser build --snapshot --id lk-darwin, and the Package archives step against its output produce the same archive layout as the v2.18.4 assets.

Expected: ~39 min → ~5 min when caches are warm, ~8 min cold.

u9g added 2 commits September 2, 2026 14:26
…'s caches

The Release job built darwin plus all four zig cross targets in one goreleaser
invocation on a single 3-core macOS runner (37 min in v2.18.5), with setup-go's
default GOCACHE that the Go Test workflow populates with -race objects no cross
target can use. PR #951 fixed both for build.yaml but not here.

Cross targets now build on a Linux matrix with the same cache keys and paths as
build.yaml, so a tag pushed after a main build restores warm objects (~35s per
target vs ~6 min cold). macOS only builds darwin. goreleaser OSS can't release
prebuilt binaries, so each job archives its own output in the same layout and a
final job writes checksums.txt and creates the draft release with gh.
@u9g
u9g merged commit 89fcf5b into main Sep 3, 2026
25 checks passed
@u9g
u9g deleted the jason/release-matrix branch September 3, 2026 15:58
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