From c331e33178d1a43f61a6937cb2f46782ec6d7b55 Mon Sep 17 00:00:00 2001 From: Joona Hoikkala <5235109+joohoi@users.noreply.github.com> Date: Thu, 5 Feb 2026 17:06:21 +0200 Subject: [PATCH] Update goreleaser configuration and add a GitHub action to build a release on new version tags (#395) --- .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ .goreleaser.yml | 1 + 2 files changed, 38 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..8a630a4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: goreleaser + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +jobs: + goreleaser: + 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: stable + - name: Import GPG key + id: import_gpg + uses: crazy-max/ghaction-import-gpg@v6 + with: + gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.GPG_PASSPHRASE }} + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v6 + with: + distribution: goreleaser + version: latest + args: release --clean + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.goreleaser.yml b/.goreleaser.yml index d8740bf..9fccd73 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -19,3 +19,4 @@ archives: signs: - artifacts: checksum + args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]