Skip to content

Commit dbae1c9

Browse files
committed
Sign releases
1 parent 7050716 commit dbae1c9

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/release.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,18 @@ jobs:
2020
- name: Describe plugin
2121
id: plugin_describe
2222
run: echo "::set-output name=api_version::$(go run . describe | jq -r '.api_version')"
23-
23+
- name: Import GPG key
24+
id: import_gpg
25+
uses: crazy-max/ghaction-import-gpg@v5
26+
with:
27+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
28+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
2429
- name: Run GoReleaser
2530
uses: goreleaser/goreleaser-action@v2
2631
with:
2732
version: latest
2833
args: release --rm-dist
2934
env:
35+
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
3036
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3137
API_VERSION: ${{ steps.plugin_describe.outputs.api_version }}

.goreleaser.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ archives:
6262
checksum:
6363
name_template: '{{ .ProjectName }}_v{{ .Version }}_SHA256SUMS'
6464
algorithm: sha256
65+
signs:
66+
- artifacts: checksum
67+
args:
68+
# if you are using this is in a GitHub action or some other automated pipeline, you
69+
# need to pass the batch flag to indicate its not interactive.
70+
- "--batch"
71+
- "--local-user"
72+
- "{{ .Env.GPG_FINGERPRINT }}"
73+
- "--output"
74+
- "${signature}"
75+
- "--detach-sign"
76+
- "${artifact}"
6577
release:
6678
# If you want to manually examine the release before its live, uncomment this line:
6779
# draft: true

0 commit comments

Comments
 (0)