refactor: update goreleaser configuration for improved build and release process
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
|
|
||||||
|
version: 2
|
||||||
|
|
||||||
before:
|
before:
|
||||||
hooks:
|
hooks:
|
||||||
- go mod tidy
|
- go mod tidy
|
||||||
|
- go generate ./...
|
||||||
|
|
||||||
builds:
|
builds:
|
||||||
- env:
|
- env:
|
||||||
@@ -10,50 +14,37 @@ builds:
|
|||||||
- windows
|
- windows
|
||||||
goarch:
|
goarch:
|
||||||
- amd64
|
- 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:
|
archives:
|
||||||
- format: binary
|
- format: tar.gz
|
||||||
name_template: "{{ .Binary }}"
|
name_template: >-
|
||||||
allow_different_binary_count: true
|
{{ .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:
|
changelog:
|
||||||
name_template: 'checksums.txt'
|
sort: asc
|
||||||
extra_files:
|
filters:
|
||||||
- glob: ./**.xz
|
exclude:
|
||||||
|
- "^docs:"
|
||||||
force_token: gitea
|
- "^test:"
|
||||||
|
|
||||||
snapshot:
|
|
||||||
name_template: "{{ .Branch }}-devel"
|
|
||||||
|
|
||||||
nightly:
|
|
||||||
name_template: "{{ .Branch }}"
|
|
||||||
|
|
||||||
gitea_urls:
|
|
||||||
api: https://gitea.s1d3sw1ped.com/api/v1
|
|
||||||
download: https://gitea.s1d3sw1ped.com
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
extra_files:
|
extra_files:
|
||||||
- glob: ./**.xz
|
- 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
|
||||||
Reference in New Issue
Block a user