fix(release): build kandev binary with -tags fts5 (#1007)

* fix(release): build kandev binary with -tags fts5

The tasks_fts virtual table + sync triggers shipped in v0.50.0 (#914)
require the fts5 SQLite build tag, which apps/backend/Makefile already
sets. The release workflow did not, so published binaries lack the
module and fail to open any DB that an FTS5-enabled build previously
touched ("no such module: fts5" during schema init).

Add -tags fts5 to the kandev build and propagate the standard version
ldflags from the Makefile so kandev --version reports the released tag.

Fixes #1006.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* fix(release): propagate version ldflags to cross-compiled agentctl

The linux/amd64 agentctl helper is built in a separate workflow step
whose shell does not inherit LDFLAGS from the previous build step.
Export LDFLAGS via \$GITHUB_ENV so the cross-compiled binary embeds
the same Version/Commit/BuildTime metadata as the matrix-built
agentctl, matching apps/backend/Makefile's build-agentctl-linux
target.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
João Salavisa
2026-05-22 09:53:11 +01:00
committed by GitHub
parent f98395f000
commit 35b18aa853
+19 -3
View File
@@ -360,15 +360,31 @@ jobs:
sudo apt-get update
sudo apt-get install -y gcc-mingw-w64-x86-64
# The `fts5` build tag is REQUIRED on the kandev binary. The office
# task search migrations create a `tasks_fts` virtual table using
# `USING fts5(...)`; without the tag, mattn/go-sqlite3 lacks the
# module and any subsequent boot against a DB that already has the
# virtual table fails with "no such module: fts5" during schema init.
# See issue #1006 for the regression this prevents.
#
# Version ldflags mirror apps/backend/Makefile so `kandev --version`
# reports the released tag instead of the build-time default "dev".
- name: Build backend binaries
env:
CC: ${{ matrix.cc || '' }}
KANDEV_VERSION: ${{ needs.prepare.outputs.tag }}
run: |
cd apps/backend
mkdir -p bin
EXT=${{ matrix.goos == 'windows' && '.exe' || '' }}
go build -o bin/kandev${EXT} ./cmd/kandev
go build -o bin/agentctl${EXT} ./cmd/agentctl
COMMIT=$(git rev-parse --short HEAD)
BUILD_TIME=$(date -u '+%Y-%m-%dT%H:%M:%SZ')
LDFLAGS="-s -w -X main.Version=${KANDEV_VERSION} -X main.Commit=${COMMIT} -X main.BuildTime=${BUILD_TIME}"
# Export to subsequent steps so the cross-compiled agentctl helper
# below gets the same version metadata (matches Makefile parity).
echo "LDFLAGS=${LDFLAGS}" >> "${GITHUB_ENV}"
go build -tags fts5 -ldflags "${LDFLAGS}" -o bin/kandev${EXT} ./cmd/kandev
go build -ldflags "${LDFLAGS}" -o bin/agentctl${EXT} ./cmd/agentctl
# Cross-compile a linux/amd64 agentctl regardless of the host platform.
# Remote executors (local Docker, remote Docker, Sprites) bind-mount this
@@ -379,7 +395,7 @@ jobs:
- name: Build linux/amd64 agentctl helper
run: |
cd apps/backend
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 CC= go build -o bin/agentctl-linux-amd64 ./cmd/agentctl
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 CC= go build -ldflags "${LDFLAGS}" -o bin/agentctl-linux-amd64 ./cmd/agentctl
- name: Package bundle
run: |