From 65d381d664ae55f61c6780f54e4a2736f963508d Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 3 Jul 2024 10:05:57 +0100 Subject: [PATCH 1/2] ci(release): fix goreleaser config to be compatible with v2 --- .goreleaser.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0f884210..a8e52b3a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 before: hooks: - go mod tidy @@ -24,12 +25,15 @@ builds: ignore: - goos: darwin goarch: "386" + archives: - format: zip name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + checksum: name_template: "{{ .ProjectName }}_{{ .Version }}_SHA256SUMS" algorithm: sha256 + signs: - artifacts: checksum args: @@ -40,7 +44,11 @@ signs: - "${signature}" - "--detach-sign" - "${artifact}" + snapshot: name_template: "{{ .Tag }}-next" -changelog: - skip: true + +# GitHub release and release notes are created by the release-please action, so +# we only need to upload the artifacts. +release: + mode: keep-existing From dbeabd4690d035de8174e308cb686b0ef756565e Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 3 Jul 2024 10:08:47 +0100 Subject: [PATCH 2/2] ci(lint): add goreleaser-config job to check goreleaser configuration This should prevent us from running into issues while trying to cut a release cause something is outdated/wrong in the goreleaser config. --- .github/workflows/ci.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 15085e9a..afb9dd65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -89,10 +89,28 @@ jobs: - name: Ensure generated documentation is up to date run: mv docs docs-current && make docs && diff -rN docs-current docs + goreleaser-config: + name: Goreleaser Config + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: goreleaser check + uses: goreleaser/goreleaser-action@v6 + with: + version: "~> v2" + args: check + release-please: name: Release Please runs-on: ubuntu-latest - needs: [lint, lint-provider, tidy, test, docs] + needs: [lint, lint-provider, tidy, test, docs, goreleaser-config] if: github.ref == 'refs/heads/main' outputs: release_created: ${{ steps.release-please.outputs.release_created }}