Skip to content

Commit 34bed3f

Browse files
authored
ci: fix gpg import in release workflow (#568)
1 parent f2cb1ea commit 34bed3f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,14 @@ jobs:
3232
-
3333
name: Import GPG key
3434
id: import_gpg
35-
uses: paultyng/[email protected]
36-
env:
37-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
38-
PASSPHRASE: ${{ secrets.PASSPHRASE }}
35+
run: |
36+
gpg-agent --daemon --allow-preset-passphrase
37+
gpg --batch --import --yes <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
38+
export KEY_FINGERPRINT=$(gpg --list-secret-keys --with-colons | grep sec | cut -d ':' -f 5)
39+
export KEY_GRIP=$(gpg-connect-agent 'KEYINFO --list' /bye | grep KEYINFO | cut -d ' ' -f 3)
40+
export PASSPHRASE_HEX=$(echo -n "${{ secrets.GPG_PASSPHRASE }}" | xxd -p -u -c 265)
41+
gpg-connect-agent "PRESET_PASSPHRASE $KEY_GRIP -1 $PASSPHRASE_HEX" /bye
42+
echo "::set-output name=fingerprint::$KEY_FINGERPRINT"
3943
-
4044
name: Run GoReleaser
4145
uses: goreleaser/goreleaser-action@v2

0 commit comments

Comments
 (0)