Skip to content

Commit

Permalink
ci: sign releases with gpg
Browse files Browse the repository at this point in the history
  • Loading branch information
lindell committed Nov 4, 2023
1 parent adf5f18 commit 29a9a1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ jobs:
go-version-file: "go.mod"
if: ${{ steps.release.outputs.release_created }}

- name: Import GPG key for signing
run: echo "${GPG_PRIVATE_KEY}" | gpg --import
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:
Expand All @@ -42,6 +47,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GENERAL_GITHUB_SECRET }} # The tokens needs access to another repo, so the secret.GITHUB_SECRET won't suffice
FURY_TOKEN: ${{ secrets.FURY_TOKEN }} # Gemfury token
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} # Fingerprint of GPG signing key
if: ${{ steps.release.outputs.release_created }}

- name: Comment on prs and issues
Expand Down
3 changes: 3 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,6 @@ publishers:
- packages
dir: "{{ dir .ArtifactPath }}"
cmd: curl -F package=@{{ .ArtifactName }} https://{{ .Env.FURY_TOKEN }}@push.fury.io/multi-gitter/
signs:
- artifacts: checksum
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"]

0 comments on commit 29a9a1e

Please sign in to comment.