From 7fcba6673a5379e57fbbad52f1bb0b5ebe732e16 Mon Sep 17 00:00:00 2001 From: Matthias Diester Date: Thu, 14 Mar 2024 17:16:24 +0100 Subject: [PATCH] Replace `replacements` with `name_template` Bump to `goreleaser/goreleaser-action@v5`. Remove pinned GoReleaser version. Replaced deprecated `replacements` with a `name_template` to achieve the same output: cli_0.12.0_windows_x86_64.tar.gz cli_0.12.0_macOS_arm64.tar.gz cli_0.12.0_linux_x86_64.tar.gz cli_0.12.0_macOS_x86_64.tar.gz cli_0.12.0_linux_arm64.tar.gz cli_0.12.0_windows_arm64.tar.gz Signed-off-by: Matthias Diester --- .github/workflows/release.yml | 5 ++--- .goreleaser.yml | 14 +++++++++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05dc83190..b2aee8149 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,9 +41,8 @@ jobs: "${GITHUB_WORKSPACE}/.github/draft_release_notes.sh" - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v5 with: - version: v1.18.2 - args: release --rm-dist --release-notes /tmp/release-notes/Changes.md + args: release --clean --release-notes /tmp/release-notes/Changes.md env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 462deeccb..8af0b2b4f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,8 @@ +--- before: hooks: - go generate ./... + builds: - env: - CGO_ENABLED=0 @@ -17,14 +19,20 @@ builds: - -s -w -extldflags "-static" -X github.com/shipwright-io/cli/pkg/shp/cmd/version.version={{.Version}} main: ./cmd/shp/main.go binary: shp + archives: -- replacements: - darwin: macOS - amd64: x86_64 +- name_template: >- + {{ .ProjectName }}_ + {{- .Version }}_ + {{- if eq .Os "darwin" }}macOS{{- else }}{{ .Os }}{{ end -}}_ + {{- if eq .Arch "amd64" }}x86_64{{- else }}{{ .Arch }}{{ end -}} + checksum: name_template: 'checksums.txt' + snapshot: name_template: "{{ incpatch .Version }}-next" + changelog: sort: asc filters: