From ffab3c99e32531a062e9674bbb4f38f850b9a261 Mon Sep 17 00:00:00 2001 From: Ilker Manap Date: Thu, 8 Oct 2026 13:44:53 +0200 Subject: [PATCH] llmgw-kb built for Windows, macOS and Linux in CI and attached to releases Co-Authored-By: Claude Opus 5.5 (1M context) --- .gitea/workflows/ci.yml | 8 ++++++++ .gitea/workflows/release.yml | 16 ++++++++++++++++ Makefile | 1 + 3 files changed, 25 insertions(+) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index b2f51c8..eb5b379 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -39,6 +39,14 @@ jobs: - name: Build run: go build ./... + # llmgw-kb runs on people's own machines, Windows included, which no + # test here runs on: building it for each catches a Unix-only call. + - name: Build llmgw-kb for every system + run: | + for target in windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 linux/amd64 linux/arm64; do + CGO_ENABLED=0 GOOS="${target%/*}" GOARCH="${target#*/}" go build -o /dev/null ./cmd/llmgw-kb + done + # The Terraform provider is a module of its own, which ./... above does # not reach. Its tests check its client against docs/admin-api.openapi.json, # so a change to the admin API that breaks the provider fails here. The diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index a557848..ace87e0 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -55,6 +55,21 @@ jobs: (cd dist && sha256sum "${name}" >> checksums.txt) done + # llmgw-kb, which people run on their own machines to put their + # documents into a knowledge base: Windows too, which llmgw itself + # does not build for. + for target in windows/amd64 windows/arm64 darwin/amd64 darwin/arm64 linux/amd64 linux/arm64; do + os="${target%/*}"; arch="${target#*/}" + ext=""; [ "$os" = windows ] && ext=".exe" + name="llmgw-kb-${version}-${os}-${arch}${ext}" + echo "building $name" + CGO_ENABLED=0 GOOS="$os" GOARCH="$arch" go build \ + -trimpath \ + -ldflags "-s -w -X gitea.mynodes.xyz/ilker/llmgw/internal/version.Version=${version}" \ + -o "dist/${name}" ./cmd/llmgw-kb + (cd dist && sha256sum "${name}" >> checksums.txt) + done + # The reverse proxy configurations, so a release page carries # everything install.md asks for and the repository is not needed. for f in deploy/proxy/Caddyfile deploy/proxy/nginx.conf; do @@ -91,6 +106,7 @@ jobs: # test the cross-compiled ones, which is why the native build is # checked rather than assumed. ./dist/llmgw-${version}-linux-amd64 --version + ./dist/llmgw-kb-${version}-linux-amd64 --version cat dist/checksums.txt # Signed, so a machine that trusts the key built into it installs diff --git a/Makefile b/Makefile index ac7040b..b012eaf 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ LDFLAGS := -X '$(MODULE)/internal/version.Version=$(VERSION)' build: go build -ldflags "$(LDFLAGS)" -o bin/llmgw ./cmd/llmgw + go build -ldflags "$(LDFLAGS)" -o bin/llmgw-kb ./cmd/llmgw-kb test: go test ./...