add: goreleaser

This commit is contained in:
2026-02-06 14:31:36 +08:00
parent 6ec897468f
commit 2a0f2901b4
17 changed files with 162 additions and 103 deletions

View File

@@ -46,20 +46,17 @@ tasks:
platforms: [windows]
- cmd: rm -f *.syso
platforms: [linux, darwin]
- cmd: upx -t "{{.BIN_DIR}}/{{.APP_NAME}}.exe" || upx "{{.BIN_DIR}}/{{.APP_NAME}}.exe"
platforms: [linux]
vars:
BUILD_FLAGS: '{{if eq .DEV "true"}}-buildvcs=false -gcflags=all="-l"{{else}}-tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui"{{end}}'
VERSION:
sh: git describe --tags --always
BUILD_FLAGS: '{{if eq .DEV "true"}}-buildvcs=false -gcflags=all="-l"{{else}}-tags production -trimpath -buildvcs=false -ldflags="-w -s -H windowsgui -X mesh-drop/internal/config.Version={{.VERSION}}"{{end}}'
env:
GOOS: windows
CGO_ENABLED: '{{.CGO_ENABLED | default "0"}}'
GOARCH: "{{.ARCH | default ARCH}}"
build:prod:
summary: Builds the application for Windows
deps:
- task: build
cmds:
- upx --best --lzma "{{.BIN_DIR}}/{{.APP_NAME}}.exe"
build:docker:
summary: Cross-compiles for Windows using Docker with Zig (for CGO builds on non-Windows)
internal: true