refactor: update goreleaser configuration for improved build and release process

This commit is contained in:
2025-01-21 13:34:51 -06:00
parent 4721373f67
commit e66ec227b0

View File

@@ -1,6 +1,10 @@
version: 2
before:
hooks:
- go mod tidy
- go generate ./...
builds:
- env:
@@ -10,50 +14,37 @@ builds:
- windows
goarch:
- amd64
flags:
- -trimpath
ldflags:
- -s -w -X main.Version={{ .Version }}
binary: >-
{{ .ProjectName }}-
{{- .Version }}-
{{- .Os }}-
{{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "amd64_v1" }}amd64
{{- else if eq .Arch "386" }}386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }}
no_unique_dist_dir: true
hooks:
post:
- cmd: xz -k -9 {{ .Path }}
dir: ./dist/
- cmd: sh .goreleaser.checksum.sh {{ .Path }}
- cmd: sh .goreleaser.checksum.sh {{ .Path }}.xz
archives:
- format: binary
name_template: "{{ .Binary }}"
allow_different_binary_count: true
- format: tar.gz
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 }}
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
extra_files:
- glob: ./**.xz
force_token: gitea
snapshot:
name_template: "{{ .Branch }}-devel"
nightly:
name_template: "{{ .Branch }}"
gitea_urls:
api: https://gitea.s1d3sw1ped.com/api/v1
download: https://gitea.s1d3sw1ped.com
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"
release:
extra_files:
- glob: ./**.xz
- glob: ./**.xz.sha256
- glob: ./**.xz.sha256
footer: >-
---
Released by [GoReleaser](https://github.com/goreleaser/goreleaser).
gitea_urls:
api: https://gitea.s1d3sw1ped.com/api/v1
download: https://gitea.s1d3sw1ped.com