chore: refine goreleaser configuration and output

- Change the name template in `.goreleaser.yaml` from single to double quotes
- Add a changelog configuration to `.goreleaser.yaml` with categorized groups for features, bug fixes, enhancements, refactor, and others

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2024-04-02 14:57:44 +08:00
parent f37c5b3557
commit f8b1db2997
No known key found for this signature in database

View File

@ -3,78 +3,78 @@ before:
- go mod tidy - go mod tidy
builds: builds:
- env: - env:
- CGO_ENABLED=0 - CGO_ENABLED=0
goos: goos:
- darwin - darwin
- linux - linux
- windows - windows
- freebsd - freebsd
goarch: goarch:
- amd64 - amd64
- arm - arm
- arm64 - arm64
goarm: goarm:
- "5" - "5"
- "6" - "6"
- "7" - "7"
ignore: ignore:
- goos: darwin - goos: darwin
goarch: arm goarch: arm
- goos: darwin - goos: darwin
goarch: ppc64le goarch: ppc64le
- goos: darwin - goos: darwin
goarch: s390x goarch: s390x
- goos: windows - goos: windows
goarch: ppc64le goarch: ppc64le
- goos: windows - goos: windows
goarch: s390x goarch: s390x
- goos: windows - goos: windows
goarch: arm goarch: arm
goarm: "5" goarm: "5"
- goos: windows - goos: windows
goarch: arm goarch: arm
goarm: "6" goarm: "6"
- goos: windows - goos: windows
goarch: arm goarch: arm
goarm: "7" goarm: "7"
- goos: windows - goos: windows
goarch: arm64 goarch: arm64
- goos: freebsd - goos: freebsd
goarch: ppc64le goarch: ppc64le
- goos: freebsd - goos: freebsd
goarch: s390x goarch: s390x
- goos: freebsd - goos: freebsd
goarch: arm goarch: arm
goarm: "5" goarm: "5"
- goos: freebsd - goos: freebsd
goarch: arm goarch: arm
goarm: "6" goarm: "6"
- goos: freebsd - goos: freebsd
goarch: arm goarch: arm
goarm: "7" goarm: "7"
- goos: freebsd - goos: freebsd
goarch: arm64 goarch: arm64
flags: flags:
- -trimpath - -trimpath
ldflags: ldflags:
- -s -w - -s -w
- -X main.Version={{.Version}} - -X main.Version={{.Version}}
binary: >- binary: >-
{{ .ProjectName }}- {{ .ProjectName }}-
{{- if .IsSnapshot }}{{ .Branch }}- {{- if .IsSnapshot }}{{ .Branch }}-
{{- else }}{{- .Version }}-{{ end }} {{- else }}{{- .Version }}-{{ end }}
{{- .Os }}- {{- .Os }}-
{{- if eq .Arch "amd64" }}amd64 {{- if eq .Arch "amd64" }}amd64
{{- else if eq .Arch "amd64_v1" }}amd64 {{- else if eq .Arch "amd64_v1" }}amd64
{{- else if eq .Arch "386" }}386 {{- else if eq .Arch "386" }}386
{{- else }}{{ .Arch }}{{ end }} {{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}-{{ .Arm }}{{ end }} {{- if .Arm }}-{{ .Arm }}{{ end }}
no_unique_dist_dir: true no_unique_dist_dir: true
hooks: hooks:
post: post:
- cmd: xz -k -9 {{ .Path }} - cmd: xz -k -9 {{ .Path }}
dir: ./dist/ dir: ./dist/
archives: archives:
- format: binary - format: binary
@ -82,9 +82,9 @@ archives:
allow_different_binary_count: true allow_different_binary_count: true
checksum: checksum:
name_template: 'checksums.txt' name_template: "checksums.txt"
extra_files: extra_files:
- glob: ./**.xz - glob: ./**.xz
snapshot: snapshot:
name_template: "{{ incpatch .Version }}" name_template: "{{ incpatch .Version }}"
@ -97,3 +97,21 @@ release:
# Templates: allowed # Templates: allowed
extra_files: extra_files:
- glob: ./**.xz - glob: ./**.xz
changelog:
use: github
groups:
- title: Features
regexp: "^.*feat[(\\w)]*:+.*$"
order: 0
- title: "Bug fixes"
regexp: "^.*fix[(\\w)]*:+.*$"
order: 1
- title: "Enhancements"
regexp: "^.*chore[(\\w)]*:+.*$"
order: 2
- title: "Refactor"
regexp: "^.*refactor[(\\w)]*:+.*$"
order: 3
- title: Others
order: 999