From bd9896b8390599e5daaa6dfe452726080d5668f1 Mon Sep 17 00:00:00 2001 From: Derek Date: Mon, 18 Dec 2023 22:41:46 -0800 Subject: [PATCH] fix: goreleaser go1.21 and fix artifact template for deprecation (#93) - Run goreleaser in go 1.21 (stable). - Add goreleaser artifact naming template to keep package names the same - Ensure files in artifact archive are owned root:root with a parent directory. --- .github/workflows/release.yaml | 2 ++ .goreleaser.yml | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2792c92..3d9025b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,8 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 + with: + go-version: 'stable' - name: Install dependencies run: | diff --git a/.goreleaser.yml b/.goreleaser.yml index 2c51bca..5d7e40f 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,6 +1,7 @@ before: hooks: - go mod tidy + - go generate ./... builds: - env: - CGO_ENABLED=1 @@ -9,6 +10,20 @@ builds: - linux goarch: - amd64 +archives: + - builds_info: + group: root + owner: root + wrap_in_directory: true + format: tar.gz + # 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 }} checksum: name_template: 'checksums.txt' snapshot: