Skip to content

Commit ac71b69

Browse files
committed
Remove importing the public GPG key
since it turned out to be useless for jreleaser script Signed-off-by: marko-bekhta <[email protected]>
1 parent 43ca63b commit ac71b69

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

release.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ function gpg_import() {
145145
keyId=$(gpg "${@}" --batch --import "$privateKeyPath" 2>&1 | tee >(cat 1>&2) | grep 'key.*: secret key imported' | sed -E 's/.*key ([^:]+):.*/\1/')
146146
# output the fingerprint of the imported key
147147
gpg "${@}" --list-secret-keys --with-colon "$keyId" | sed -E '2!d;s/.*:([^:]+):$/\1/'
148+
export JRELEASER_GPG_KEYNAME=$keyId
148149
}
149150

150151
function gpg_delete() {
@@ -153,12 +154,6 @@ function gpg_delete() {
153154
gpg "${@}" --batch --yes --delete-secret-keys "$fingerprint"
154155
}
155156

156-
function gpg_delete_public() {
157-
local fingerprint="$1"
158-
shift
159-
gpg "${@}" --batch --yes --delete-keys "$fingerprint"
160-
}
161-
162157
#--------------------------------------------
163158
# Cleanup on exit
164159

@@ -167,10 +162,6 @@ function cleanup() {
167162
echo "Deleting imported GPG private key..."
168163
gpg_delete "$IMPORTED_KEY" || true
169164
fi
170-
if [ -n "$IMPORTED_PUBLIC_KEY" ]; then
171-
echo "Deleting imported GPG public key..."
172-
gpg_delete_public "$IMPORTED_PUBLIC_KEY" || true
173-
fi
174165
if [ -d "$RELEASE_GPG_HOMEDIR" ]; then
175166
echo "Cleaning up GPG homedir..."
176167
rm -rf "$RELEASE_GPG_HOMEDIR" || true
@@ -195,7 +186,6 @@ if [ -z "$IMPORTED_KEY" ]; then
195186
echo "Failed to import GPG key"
196187
exit 1
197188
fi
198-
IMPORTED_PUBLIC_KEY="$(gpg_import "$RELEASE_GPG_PUBLIC_KEY_PATH")"
199189

200190
if [ "$PUSH_CHANGES" != "true" ]; then
201191
ADDITIONAL_OPTIONS="-d"

0 commit comments

Comments
 (0)