From dcb52e51a4bed4f4040efdd096cf10d3ac6aeeac Mon Sep 17 00:00:00 2001 From: Martin Anker Have Date: Fri, 16 Aug 2024 11:35:17 +0200 Subject: [PATCH] Fix go releaser (#545) --- .github/workflows/release-check.yml | 25 +++++++++++++++++++++++++ .github/workflows/release.yml | 11 ++--------- .goreleaser.yml | 7 +++---- 3 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/release-check.yml diff --git a/.github/workflows/release-check.yml b/.github/workflows/release-check.yml new file mode 100644 index 00000000..5060d771 --- /dev/null +++ b/.github/workflows/release-check.yml @@ -0,0 +1,25 @@ +name: GoReleaser Check + +on: + push: + branches: + - "master" + pull_request: + +jobs: + goreleaser-check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: 1.23.0 + - name: Run GoReleaser Check + uses: goreleaser/goreleaser-action@v4 + with: + version: latest + args: check diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b9e6cfa7..ef173448 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,14 +18,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: 1.23.0 - - name: Cache Go modules - uses: actions/cache@v4 - with: - path: ~/go/pkg/mod - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- + go-version: 1.23.0 - name: Docker Login uses: docker/login-action@v3 with: @@ -37,6 +30,6 @@ jobs: with: distribution: goreleaser version: latest - args: release --rm-dist + args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index abf30ad9..a94d24fa 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,5 +1,4 @@ -# This is an example goreleaser.yaml file with some sane defaults. -# Make sure to check the documentation at http://goreleaser.com +version: 2 builds: - binary: artifact @@ -62,11 +61,11 @@ checksum: name_template: '{{ .ProjectName }}-checksums.txt' snapshot: - name_template: "git-{{.Commit}}" + version_template: "git-{{.Commit}}" release: name_template: "v{{.Version}}" prerelease: auto changelog: - skip: true + disable: true