From 9ae8ddbe8a84af8a636b40d3035fc8f8e1a194ce Mon Sep 17 00:00:00 2001 From: ngehrsitz <45375059+ngehrsitz@users.noreply.github.com> Date: Mon, 16 Oct 2023 04:52:03 +0200 Subject: [PATCH] Fix goreleaser configuration (#30) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Norman Gehrsitz --- .github/workflows/go.yml | 4 +-- .github/workflows/release.yml | 10 +++++-- .goreleaser.yml | 54 +++++++++++++++++++---------------- 3 files changed, 39 insertions(+), 29 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 68ae25b..2872120 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -6,10 +6,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.13 + - name: Set up Go 1.21 uses: actions/setup-go@v4 with: - go-version: 1.13 + go-version: 1.21 id: go - name: Check out code into the Go module directory diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e216c63..a002d2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,12 +10,16 @@ jobs: - name: setup go uses: actions/setup-go@v4 with: - go-version: 1.14 + go-version: 1.21 - name: checkout uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: 0 - name: run GoReleaser - uses: goreleaser/goreleaser-action@v1 + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: v1.21.2 + args: release --clean env: GITHUB_TOKEN: ${{ secrets.github_token }} diff --git a/.goreleaser.yml b/.goreleaser.yml index ec42caa..76569f7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -37,34 +37,40 @@ nfpms: maintainer: "Teppei Fukuda " description: "Continuous Benchmark for Go Project" license: "MIT" - file_name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}" - replacements: - amd64: 64bit - 386: 32bit - arm: ARM - arm64: ARM64 - darwin: macOS - linux: Linux - openbsd: OpenBSD - netbsd: NetBSD - freebsd: FreeBSD - dragonfly: DragonFlyBSD + file_name_template: >- + {{- .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macOS + {{- else if eq .Os "linux" }}Linux + {{- else if eq .Os "openbsd" }}OpenBSD + {{- else if eq .Os "netbsd" }}NetBSD + {{- else if eq .Os "freebsd" }}FreeBSD + {{- else if eq .Os "dragonfly" }}DragonFlyBSD + {{- else }}{{ .Os }}{{ end }}- + {{- if eq .Arch "amd64" }}64bit + {{- else if eq .Arch "386" }}32bit + {{- else if eq .Arch "arm" }}ARM + {{- else if eq .Arch "arm64" }}ARM64 + {{- else }}{{ .Arch }}{{ end }} archives: - format: tar.gz - name_template: "{{.ProjectName}}_{{.Version}}_{{.Os}}-{{.Arch}}" - replacements: - amd64: 64bit - 386: 32bit - arm: ARM - arm64: ARM64 - darwin: macOS - linux: Linux - openbsd: OpenBSD - netbsd: NetBSD - freebsd: FreeBSD - dragonfly: DragonFlyBSD + name_template: >- + {{- .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macOS + {{- else if eq .Os "linux" }}Linux + {{- else if eq .Os "openbsd" }}OpenBSD + {{- else if eq .Os "netbsd" }}NetBSD + {{- else if eq .Os "freebsd" }}FreeBSD + {{- else if eq .Os "dragonfly" }}DragonFlyBSD + {{- else }}{{ .Os }}{{ end }}- + {{- if eq .Arch "amd64" }}64bit + {{- else if eq .Arch "386" }}32bit + {{- else if eq .Arch "arm" }}ARM + {{- else if eq .Arch "arm64" }}ARM64 + {{- else }}{{ .Arch }}{{ end }} files: - README.md - LICENSE