Skip to content

Commit e63bd96

Browse files
committed
release workflow
1 parent 691132f commit e63bd96

1 file changed

Lines changed: 11 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff 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 }}

0 commit comments

Comments
 (0)