File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,16 +26,21 @@ jobs:
2626 go-version-file : ' go.mod'
2727 cache : true
2828 - name : Import GPG key
29- uses : crazy-max/ghaction-import-gpg@2dc316deee8e90f13e1a351ab510b4d5bc0c82cd # v7.0.0
30- id : import_gpg
31- with :
32- gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
33- passphrase : ${{ secrets.PASSPHRASE }}
29+ env :
30+ GPG_PRIVATE_KEY : ${{ secrets.GPG_PRIVATE_KEY }}
31+ PASSPHRASE : ${{ secrets.PASSPHRASE }}
32+ run : |
33+ gpg --batch --import --yes <<<"$GPG_PRIVATE_KEY"
34+ FINGERPRINT=$(gpg --with-colons --list-keys | grep '^pub' | cut -d: -f5 | head -n 1)
35+ KEYGRIP=$(gpg --with-colons --with-keygrip --list-secret-keys | grep '^grp' | cut -d: -f10 | head -n 1)
36+ echo "allow-preset-passphrase" >> ~/.gnupg/gpg-agent.conf
37+ gpg-connect-agent reloadagent /bye
38+ /usr/lib/gnupg/gpg-preset-passphrase --preset "$KEYGRIP" <<<"$PASSPHRASE"
39+ echo "GPG_FINGERPRINT=$FINGERPRINT" >> $GITHUB_ENV
3440 - name : Run GoReleaser
3541 uses : goreleaser/goreleaser-action@ec59f474b9834571250b370d4735c50f8e2d1e29 # v7.0.0
3642 with :
3743 args : release --clean
3844 env :
3945 # GitHub sets the GITHUB_TOKEN secret automatically.
4046 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
41- GPG_FINGERPRINT : ${{ steps.import_gpg.outputs.fingerprint }}
You can’t perform that action at this time.
0 commit comments