Ship a GUI-subsystem Windows base and cover it in CI

A second goreleaser build links a Windows binary for the GUI subsystem
(-H windowsgui) and ships it as kage_<version>_windows-gui_<arch>.zip, scoped so
the package managers still install the console build. Packing a viewer onto this
base gives a double-click .exe with no console behind it. A CI job cross-compiles
the windowsgui link so it cannot rot.
This commit is contained in:
Duc-Tam Nguyen
2026-06-15 00:42:53 +07:00
parent a40da25b8c
commit 05a87960d1
2 changed files with 67 additions and 3 deletions
+19
View File
@@ -125,3 +125,22 @@ jobs:
cache: true
- name: build webview viewer
run: CGO_ENABLED=1 go build -tags webview ./cmd/kage
# Cross-compile the GUI-subsystem Windows base the release ships for
# double-click viewers (kage pack --base). A change that breaks the
# -H windowsgui link is caught here instead of at release time. Pure Go, so it
# cross-compiles from Linux with no extra toolchain.
windows-gui:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/setup-go@v6
with:
go-version-file: go.mod
check-latest: true
cache: true
- name: build windowsgui base
env:
GOOS: windows
CGO_ENABLED: "0"
run: go build -ldflags "-H=windowsgui" -o kage-windowsgui.exe ./cmd/kage