build(release): add tag-based release automation and version metadata

This commit is contained in:
alphago9
2026-03-30 01:37:08 +08:00
parent fc8d58024e
commit dea81caa61
11 changed files with 312 additions and 69 deletions
+52 -24
View File
@@ -1,44 +1,72 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
version: 2
project_name: epusdt
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 ./...
- go test ./...
builds:
- env:
- id: epusdt
main: .
binary: epusdt
env:
- CGO_ENABLED=0
flags:
- -trimpath
ldflags:
- -s -w -X github.com/assimon/luuu/config.BuildVersion={{ .Version }} -X github.com/assimon/luuu/config.BuildCommit={{ .Commit }} -X github.com/assimon/luuu/config.BuildDate={{ .Date }}
goos:
- darwin
- linux
- darwin
- windows
goarch:
- amd64
- arm
- 386
- arm64
archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
id: epusdt
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}"
format: tar.gz
- id: epusdt
ids:
- epusdt
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
files:
- .env.example
- static/*
- runtime/*
- static/**
format_overrides:
- goos: windows
formats:
- zip
checksum:
name_template: 'checksums.txt'
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"
signs:
- cmd: cosign
signature: "${artifact}.sigstore.json"
args:
- "sign-blob"
- "--bundle=${signature}"
- "${artifact}"
- "--yes"
artifacts: checksum
sboms:
- id: archives
artifacts: archive
snapshot:
name_template: "{{ incpatch .Version }}-next"
release:
github:
owner: GMwalletApp
name: epusdt
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"
- "^chore:"
- "^ci:"