From dc1d507a20413740ecf18b84a8cd2c33f3fc9557 Mon Sep 17 00:00:00 2001 From: Lukasz Raczylo Date: Sat, 3 Jan 2026 22:36:09 +0000 Subject: [PATCH] fix: enable binary builds for proper GitHub releases and Helm charts Problem: - With builds: skip: true, no artifacts were created - GoReleaser wasn't creating GitHub releases or tags - Helm chart workflow wasn't triggered (depends on tags) - No downloadable binaries for users Solution: - Enabled builds for both gohoarder and migrate binaries - CGO_ENABLED=1 for SQLite support - Added fts5 tag for full-text search - Builds run natively per platform in split/merge workflow: - darwin/arm64 (Apple Silicon Macs) - linux/amd64 (x86_64 Linux) - linux/arm64 (ARM64 Linux) - Ignored darwin/amd64 (Intel Macs) to limit build matrix How it works: 1. Split phase: Each platform builds natively (no cross-compilation) 2. Merge phase: Combines all artifacts, creates release, builds Docker images 3. Docker images still use multi-stage builds (independent of binaries) 4. GitHub release created with tags 5. Helm chart workflow triggered Benefits: - Downloadable binaries for all platforms - Archives created automatically - GitHub releases with proper tags - Helm charts published - Docker images built separately with multi-stage builds --- .goreleaser.yaml | 51 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index c11044e..d1410db 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -13,13 +13,56 @@ before: # - ./script/generate-version.sh # Build configuration -# Note: Binaries are built inside Docker containers (multi-stage builds) -# to avoid CGO cross-compilation issues. No standalone builds here. +# Builds run natively per-platform in split mode (no CGO cross-compilation) +# Docker images also use multi-stage builds independently builds: - id: gohoarder - skip: true + main: ./cmd/gohoarder + binary: gohoarder + env: + - CGO_ENABLED=1 + tags: + - fts5 + flags: + - -trimpath + ldflags: + - -s -w + - -X github.com/lukaszraczylo/gohoarder/internal/version.Version={{.Version}} + - -X github.com/lukaszraczylo/gohoarder/internal/version.GitCommit={{.ShortCommit}} + - -X github.com/lukaszraczylo/gohoarder/internal/version.BuildTime={{.Date}} + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + ignore: + - goos: darwin + goarch: amd64 + - id: migrate - skip: true + main: ./cmd/migrate + binary: migrate + env: + - CGO_ENABLED=1 + tags: + - fts5 + flags: + - -trimpath + ldflags: + - -s -w + - -X main.Version={{.Version}} + - -X main.GitCommit={{.ShortCommit}} + - -X main.BuildTime={{.Date}} + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + ignore: + - goos: darwin + goarch: amd64 # Archives for releases archives: