Files
ecs/.goreleaser.yaml
2025-07-16 16:03:46 +00:00

256 lines
5.5 KiB
YAML

version: 2
project_name: goecs
env:
- GO111MODULE=on
- CGO_ENABLED=0
before:
hooks:
- go mod tidy -v
builds:
- id: linux-cgo
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- amd64
- 386
- arm64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- id: linux-cgo-risc
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- riscv64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- id: linux-cgo-mips
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- mips64
- mips64le
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- id: linux-cgo-ppc
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
goarch:
- ppc64le
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- id: windows-cgo
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- windows
goarch:
- amd64
- 386
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- id: darwin-cgo
env:
- CGO_ENABLED=1
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0
flags:
- -trimpath
goos:
- darwin
goarch:
- amd64
- arm64
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
- id: universal
env:
- CGO_ENABLED=0
ldflags:
- -s -w -X main.version={{.Version}} -X main.arch={{.Arch}} -checklinkname=0 -extldflags=-static
flags:
- -trimpath
goos:
- linux
- windows
- freebsd
- openbsd
- netbsd
goarch:
- arm
- arm64
- 386
- amd64
- s390x
- mips
- mipsle
- ppc64
goarm:
- "5"
- "6"
- "7"
gomips:
- softfloat
ignore:
# 避免和 linux-cgo 重叠
- goos: linux
goarch: amd64
- goos: linux
goarch: 386
- goos: linux
goarch: arm64
- goos: linux
goarch: riscv64
- goos: linux
goarch: mips64
- goos: linux
goarch: mips64le
- goos: linux
goarch: ppc64le
# 避免和 windows-cgo 重叠
- goos: windows
goarch: amd64
- goos: windows
goarch: 386
# 避免和 darwin-cgo 重叠
- goos: darwin
goarch: amd64
- goos: darwin
goarch: arm64
# 原系统不支持的忽略规则
- goos: windows
goarch: arm
- goos: freebsd
goarch: 386
- goos: openbsd
goarch: 386
- goos: netbsd
goarch: 386
main: ./
binary: goecs
no_unique_dist_dir: true
hooks:
pre:
- echo "Building for {{.Os}}/{{.Arch}}"
post:
- echo "Built {{.Os}}/{{.Arch}} successfully"
- echo "Binary size:" && du -h "{{ .Path }}"
universal_binaries:
- name_template: "goecs"
replace: false
ids:
- darwin-cgo
partial:
by: target
checksum:
name_template: "checksums.txt"
algorithm: sha256
disable: false
ids:
- linux-cgo
- linux-cgo-risc
- linux-cgo-mips
- linux-cgo-ppc
- windows-cgo
- darwin-cgo
- universal
extra_files:
- glob: "./goecs.sh"
snapshot:
name_template: "goecs"
archives:
- id: default
name_template: "goecs_{{ .Os }}_{{ .Arch }}"
format: zip
files:
- none*
allow_different_binary_count: true
builds:
- linux-cgo
- linux-cgo-risc
- linux-cgo-mips
- linux-cgo-ppc
- windows-cgo
- darwin-cgo
- universal
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
- "^chore"
- Merge pull request
- Merge branch
- go mod tidy
- New translations