Files
ai/.goreleaser.yaml
zeekay f7935ee0a5 fix(ci/release): make the GoReleaser release job green — serialize builds, drop the impossible windows target, fix the archive
The github-release job (`goreleaser release`) failed three ways; the OOM
masked the latter two:

  1. OOM. GoReleaser defaults parallelism to nCPU and cross-compiled ALL
     targets at once; the concurrent COLD `go build`s of the full tree
     (it imports luxfi/geth) burst past the 8Gi arc-runner limit and the
     kernel OOM-killed it — the "self-hosted runner lost communication"
     death at ~27min that left every v1.826.x tag with no assets. The
     `backend` job proves ONE `go build ./...` fits 8Gi, so `-p 1` (one
     target at a time) is the minimal, capacity-preserving fix.

  2. windows cannot compile. aid transitively imports
     github.com/hanzoai/cloud/cek, whose keystore lock uses Unix-only
     syscall.Flock/LOCK_EX — GOOS=windows fails "undefined: syscall.Flock".
     A server daemon has no windows target anyway; build linux + darwin
     (both verified to cross-compile).

  3. archive references web/build, built ONLY by the Dockerfile front
     stage (a pnpm build here OOMs too) and absent in this Go job —
     goreleaser fails the archive on the missing path. Ship the daemon +
     conf/data; the web-serving artifact is the Docker image.

Also migrate archives.format(_overrides) → formats — the deprecated form
`goreleaser check` flagged; CI pins `~> v2`, so the eventually-removed
field would break the floating version.

Proven locally: `goreleaser release --snapshot -p 1 --skip=publish`
builds all four linux/darwin targets, archives (conf+data, no web/build),
and checksums — green.
2026-07-19 11:50:19 -07:00

59 lines
1.9 KiB
YAML

# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
# The lines below are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/need to use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
version: 2
before:
hooks:
# You may remove this if you don't use go modules.
- go mod tidy
# you may remove this if you don't need go generate
#- go generate ./...
builds:
- main: ./cmd/aid
binary: aid
env:
- CGO_ENABLED=0
# No windows: the daemon transitively imports github.com/hanzoai/cloud/cek,
# whose keystore lock uses Unix-only syscall.Flock/LOCK_EX, so the windows
# cross-compile cannot build ("undefined: syscall.Flock"). aid is a server
# daemon — linux is the deployment target, darwin covers local dev; both build.
goos:
- linux
- darwin
goarch:
- amd64
- arm64
archives:
- formats: [tar.gz]
# this name template makes the OS and Arch compatible with the results of `uname`.
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
# web/ (the console SPA) is built ONLY by the Dockerfile's `front` stage — a
# pnpm build in this Go release job OOM-killed the runner (heap >8GB), so it is
# intentionally absent here. The binary tarball ships the daemon + its runtime
# config/data; the full web-serving artifact is the Docker image.
files:
- src: 'conf/app.conf'
dst: './conf/app.conf'
- src: 'data'
dst: './data'
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"