From 1b156170a378081348920102ebc026c45c1462ad Mon Sep 17 00:00:00 2001 From: Antoine Leroyer Date: Thu, 7 Mar 2024 21:51:14 +0100 Subject: [PATCH] Update GH Actions and goreleaser config --- .github/workflows/build.yml | 8 ++++---- .github/workflows/release.yml | 10 +++++----- .goreleaser.yml | 11 +++++++---- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 63c6cfc..3b47656 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,14 +13,14 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.13 - uses: actions/setup-go@v1 + - name: Set up Go 1.22 + uses: actions/setup-go@v4 with: - go-version: 1.13 + go-version: 1.22 id: go - name: Check out code into the Go module directory - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get dependencies run: go get -v -t -d ./... diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2585ac5..1911af3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -15,17 +15,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Unshallow run: git fetch --prune --unshallow - name: Set up Go - uses: actions/setup-go@v1 + uses: actions/setup-go@v4 with: - go-version: 1.13.x + go-version: 1.22.x - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v1 + uses: goreleaser/goreleaser-action@v4 with: version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 5f1b06d..0314fcd 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -23,10 +23,13 @@ changelog: - Merge pull request - Merge branch archives: - - name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" - replacements: - linux: Linux - amd64: x86_64 + - name_template: >- + {{ .ProjectName }}_{{ .Version }}_ + {{- if eq .Os "linux" }}Linux + {{- else }}{{ .Os }}{{ end }}_ + {{- if eq .Arch "amd64" }}x86_64 + {{- else }}{{ .Arch }}{{ end }} + {{- if .Arm }}v{{ .Arm }}{{ end }} nfpms: - package_name: "rsyslog-exporter" homepage: https://github.com/aleroyer/rsyslog_exporter