From 55b4b3ce71a56c16c018f27e384500095e6efd91 Mon Sep 17 00:00:00 2001 From: AzraelSec Date: Thu, 7 Sep 2023 18:08:58 +0200 Subject: [PATCH] build: introduce `goreleaser` --- .gitignore | 2 ++ .goreleaser.yaml | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 .goreleaser.yaml diff --git a/.gitignore b/.gitignore index ad148f2..5dd7867 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ go.work bin/ + +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..9a5bdd9 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,36 @@ +before: + hooks: + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + # - windows + - darwin + main: ./cmd/cli + binary: glock + +archives: + - 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 }} + # # use zip for windows archives + # format_overrides: + # - goos: windows + # format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:'