From ff8c70ab3fe86c03390ca48ec339b12888dc3e37 Mon Sep 17 00:00:00 2001 From: Kevin Bowrin Date: Fri, 21 Jul 2023 14:49:42 -0400 Subject: [PATCH] Update GoReleaser config, add comment to gitignore --- .gitignore | 1 + .goreleaser.yaml | 32 ++++++++++++++++++++++++++++++++ .goreleaser.yml | 45 --------------------------------------------- 3 files changed, 33 insertions(+), 45 deletions(-) create mode 100644 .goreleaser.yaml delete mode 100644 .goreleaser.yml diff --git a/.gitignore b/.gitignore index 5800750..7ec668d 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,5 @@ # Dependency directories (remove the comment below to include it) # vendor/ +# GoReleaser dist folder dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..96d0215 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,32 @@ +builds: + - env: + - CGO_ENABLED=0 + targets: + - go_first_class + +archives: + - format: tar.gz + wrap_in_directory: true + # this name template makes the OS and Arch compatible with the results of uname. + 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: + algorithm: sha256 + name_template: 'sha256_checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/.goreleaser.yml b/.goreleaser.yml deleted file mode 100644 index b2b652c..0000000 --- a/.goreleaser.yml +++ /dev/null @@ -1,45 +0,0 @@ -before: - hooks: - - go mod download -builds: -- env: - - CGO_ENABLED=0 - ldflags: - - -s -w -X main.version={{.Version}} - goos: - - darwin - - linux - - freebsd - - windows - - netbsd - - openbsd - goarch: - - amd64 - - arm - - arm64 - - 386 - goarm: - - 6 - - 7 - ignore: - - goos: darwin - goarch: 386 -archives: -- name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" - replacements: - darwin: macOS - amd64: x86_64 - wrap_in_directory: true - format_overrides: - - goos: windows - format: zip -checksum: - name_template: 'checksums.txt' -snapshot: - name_template: "{{ .Tag }}-next" -changelog: - sort: asc - filters: - exclude: - - '^docs:' - - '^test:'