Skip to content

Commit 0368181

Browse files
committed
.ci/gpg: fix create-keyring.sh script to fix gpg signing releases
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
1 parent 9359e2f commit 0368181

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.ci/gpg/create-keyring.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,24 @@ declare -r SECRING_AUTO="${GPG_HOME}/secring.auto"
1414
declare -r PUBRING_AUTO="${GPG_HOME}/pubring.auto"
1515

1616
mkdir -p "$GPG_HOME"
17+
chmod 700 "$GPG_HOME"
1718
cp "${DIR}"/*.auto* "${GPG_HOME}"
1819

20+
echo -e "\nImporting public keys..."
21+
{ gpg --home "${GPG_HOME}" --import "${PUBRING_AUTO}" ; } || { err_exit "Could not import public key into gpg." ; }
22+
echo "Success!"
23+
1924
echo -e "\nDecrypting secret key..."
2025
{
2126
# $GPG_PASSWORD is taken from the script's env (injected by CI).
22-
echo $GPG_PASSWORD | gpg --decrypt \
23-
--pinentry-mode loopback --batch \
27+
echo $GPG_PASSWORD | gpg --home "${GPG_HOME}" --decrypt \
28+
--pinentry-mode loopback --yes \
2429
--passphrase-fd 0 \
2530
--output "${SECRING_AUTO}" \
2631
"${SECRING_AUTO}".gpg ; \
2732
} || { err_exit "Failed to decrypt secret key." ; }
2833
echo "Success!"
2934

30-
echo -e "\nImporting keys..."
31-
{ gpg --home "${GPG_HOME}" --import "${PUBRING_AUTO}" ; } || { err_exit "Could not import public key into gpg." ; }
35+
echo -e "\nImporting private keys..."
3236
{ gpg --home "${GPG_HOME}" --import "${SECRING_AUTO}" ; } || { err_exit "Could not import secret key into gpg." ; }
3337
echo "Success!"

0 commit comments

Comments
 (0)