diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d006c5e..9cbce87 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -20,6 +20,12 @@ jobs: uses: actions/setup-go@v4 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@v5 with: @@ -28,3 +34,4 @@ jobs: args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5bdfaca..743d7f4 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -36,3 +36,15 @@ changelog: exclude: - "^docs:" - "^test:" + +signs: + - artifacts: checksum + cmd: gpg2 + args: + - "--batch" + - "-u" + - "{{ .Env.GPG_FINGERPRINT }}" + - "--output" + - "${signature}" + - "--detach-sign" + - "${artifact}"