Fix Windows SQLite support in releases

- Enable CGO in GoReleaser config
- Add MinGW cross-compiler for Windows builds
- Split builds per platform to configure correct CC
- Install cross-compilation toolchains in release workflow

Fixes #253

Amp-Thread-ID: https://ampcode.com/threads/T-8600ed89-42af-4785-b5dc-01ad37f1451d
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Steve Yegge
2025-11-07 15:54:59 -08:00
parent 3191c9c3da
commit d3de5519b2
3 changed files with 53 additions and 10 deletions

View File

@@ -9,28 +9,65 @@ before:
- go mod tidy
builds:
- id: bd
- id: bd-linux-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=0
- CGO_ENABLED=1
goos:
- linux
- darwin
- windows
goarch:
- amd64
- arm64
ignore:
- goos: linux
goarch: arm64
- goos: windows
goarch: arm64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- id: bd-darwin-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
goos:
- darwin
goarch:
- amd64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- id: bd-darwin-arm64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
goos:
- darwin
goarch:
- arm64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- id: bd-windows-amd64
main: ./cmd/bd
binary: bd
env:
- CGO_ENABLED=1
- CC=x86_64-w64-mingw32-gcc
- CXX=x86_64-w64-mingw32-g++
goos:
- windows
goarch:
- amd64
ldflags:
- -s -w
- -X main.Version={{.Version}}
- -X main.Build={{.ShortCommit}}
- -buildmode=exe
archives:
- id: bd-archive
format: tar.gz