From 445a6e9c07b360e30a71fd2bd4b6449e8d174001 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 1 Mar 2026 01:47:43 -0700 Subject: [PATCH] feat(monorel): expand default build matrix to all practical CGO_ENABLED=0 targets Replace linux/windows/darwin with the full CGO_ENABLED=0 goos list: aix, darwin, dragonfly, freebsd, illumos, js, linux, netbsd, openbsd, plan9, solaris, wasip1, windows Add commented-out stanzas for each binary for platforms that require extra tooling: - iOS (CGO_ENABLED=1, Xcode toolchain required) - Android (CGO_ENABLED=0 arm64-only; NDK required for full CGO builds) Archive formats unchanged (tar.gz + tar.zst / zip + tar.gz for Windows). --- tools/monorel/main.go | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tools/monorel/main.go b/tools/monorel/main.go index eb62930..47b425e 100644 --- a/tools/monorel/main.go +++ b/tools/monorel/main.go @@ -1255,7 +1255,41 @@ func goreleaserYAML(projectName string, bins []binary) string { " -X main.commit={{.Commit}}" + " -X main.date={{.Date}}" + " -X main.builtBy=goreleaser\n") - w(" goos:\n - linux\n - windows\n - darwin\n") + w(" goos:\n") + w(" - aix\n") + w(" - darwin\n") + w(" - dragonfly\n") + w(" - freebsd\n") + w(" - illumos\n") + w(" - js\n") + w(" - linux\n") + w(" - netbsd\n") + w(" - openbsd\n") + w(" - plan9\n") + w(" - solaris\n") + w(" - wasip1\n") + w(" - windows\n") + + // iOS requires CGO and Xcode toolchain — commented out by default. + wf(" # iOS requires CGO_ENABLED=1 and the Xcode toolchain.\n") + wf(" #- id: %s-ios\n", bin.name) + wf(" # binary: %s\n", bin.name) + if bin.mainPath != "." { + wf(" # main: %s\n", bin.mainPath) + } + w(" # env:\n # - CGO_ENABLED=1\n") + w(" # goos:\n # - ios\n") + + // Android: CGO_ENABLED=0 supports arm64 only; full CGO requires the NDK. + wf(" # Android CGO_ENABLED=0 builds arm64 only; CGO builds require the NDK.\n") + wf(" #- id: %s-android\n", bin.name) + wf(" # binary: %s\n", bin.name) + if bin.mainPath != "." { + wf(" # main: %s\n", bin.mainPath) + } + w(" # env:\n # - CGO_ENABLED=0\n") + w(" # goos:\n # - android\n") + w(" # goarch:\n # - arm64\n") } w("\narchives:\n")