From 3bb57b774112f228faca3de61a6da78db2f6c9c6 Mon Sep 17 00:00:00 2001 From: Justin Harms Date: Tue, 21 Jan 2025 13:34:51 -0600 Subject: [PATCH] refactor: update goreleaser configuration for improved build and release process --- .goreleaser.yaml | 71 +++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 40 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 940a3b6..208fd1f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -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 \ No newline at end of file + - 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 \ No newline at end of file