Skip to content

Commit

Permalink
fix: release
Browse files Browse the repository at this point in the history
  • Loading branch information
kvendingoldo committed Jun 6, 2024
1 parent 908d2ad commit 8bd3adf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ jobs:
- name: Import GPG key
id: gpg
run: |
GPG_KEY_FILE=/tmp/signing-key.gpg
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode > "${GPG_KEY_FILE}"
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode | gpg --batch --passphrase "${{ secrets.GPG_PASSPHRASE }}" --import
GPG_FINGERPRINT=$(gpg --list-secret-keys --keyid-format LONG | awk '/^sec/{sub(/.*\//, "", $2); print $2; exit}')
echo "${GPG_PRIVATE_KEY}" | gpg --import --passphrase "${GPG_PASSPHRASE}" --batch --allow-secret-key-import
echo "GPG_FINGERPRINT=${GPG_FINGERPRINT}" >>"${GITHUB_ENV}"
GPG_KEY_FILE=/tmp/signing-key.gpg
echo "${GPG_PRIVATE_KEY}" > "${GPG_KEY_FILE}"
echo "GPG_KEY_FILE=${GPG_KEY_FILE}" >> "${GITHUB_ENV}"
env:
GPG_TTY: /dev/ttys000 # Set the GPG_TTY to avoid issues with pinentry
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}

- name: Setup snapcraft
run: |
Expand All @@ -62,7 +62,7 @@ jobs:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_TOKEN }}
GPG_KEY_FILE: ${{ steps.gpg.outputs.GPG_KEY_FILE }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_FINGERPRINT: ${{ steps.gpg.outputs.GPG_FINGERPRINT }}
GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }}

docker-ghcr:
name: 'Build and release docker image to github container registry'
Expand Down
8 changes: 5 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -259,11 +259,13 @@ signs:
id: gpg
cmd: gpg
args:
- "--passphrase"
- "{{ .Env.GPG_PASSPHRASE }}"
- "--pinentry-mode"
- "loopback"
- "--batch"
- "--local-user"
- "--u"
- "{{ .Env.GPG_FINGERPRINT }}"
- "--passphrase"
- "{{ .Env.GPG_PASSPHRASE }}"
- "--output"
- "${signature}"
- "--detach-sign"
Expand Down

0 comments on commit 8bd3adf

Please sign in to comment.