Skip to content

Commit

Permalink
.ci/gpg: fix create-keyring.sh script to fix gpg signing releases (#290)
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Lanford <joe.lanford@gmail.com>
  • Loading branch information
joelanford authored Jan 22, 2024
1 parent 00a20d5 commit e7ea4ea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
12 changes: 8 additions & 4 deletions .ci/gpg/create-keyring.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,24 @@ declare -r SECRING_AUTO="${GPG_HOME}/secring.auto"
declare -r PUBRING_AUTO="${GPG_HOME}/pubring.auto"

mkdir -p "$GPG_HOME"
chmod 700 "$GPG_HOME"
cp "${DIR}"/*.auto* "${GPG_HOME}"

echo -e "\nImporting public keys..."
{ gpg --home "${GPG_HOME}" --import "${PUBRING_AUTO}" ; } || { err_exit "Could not import public key into gpg." ; }
echo "Success!"

echo -e "\nDecrypting secret key..."
{
# $GPG_PASSWORD is taken from the script's env (injected by CI).
echo $GPG_PASSWORD | gpg --decrypt \
--pinentry-mode loopback --batch \
echo $GPG_PASSWORD | gpg --home "${GPG_HOME}" --decrypt \
--pinentry-mode loopback --yes \
--passphrase-fd 0 \
--output "${SECRING_AUTO}" \
"${SECRING_AUTO}".gpg ; \
} || { err_exit "Failed to decrypt secret key." ; }
echo "Success!"

echo -e "\nImporting keys..."
{ gpg --home "${GPG_HOME}" --import "${PUBRING_AUTO}" ; } || { err_exit "Could not import public key into gpg." ; }
echo -e "\nImporting private keys..."
{ gpg --home "${GPG_HOME}" --import "${SECRING_AUTO}" ; } || { err_exit "Could not import secret key into gpg." ; }
echo "Success!"
2 changes: 1 addition & 1 deletion testdata/hybrid/memcached-operator/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.20
require (
github.com/onsi/ginkgo/v2 v2.13.0
github.com/onsi/gomega v1.30.0
github.com/operator-framework/helm-operator-plugins v0.1.2
github.com/operator-framework/helm-operator-plugins v0.1.3
k8s.io/apimachinery v0.28.5
k8s.io/client-go v0.28.5
sigs.k8s.io/controller-runtime v0.16.3
Expand Down
4 changes: 2 additions & 2 deletions testdata/hybrid/memcached-operator/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -285,8 +285,8 @@ github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
github.com/operator-framework/helm-operator-plugins v0.1.2 h1:gMPdJluw2NGxDURBpcLHJhWWXERCG095iHZUmACoXeE=
github.com/operator-framework/helm-operator-plugins v0.1.2/go.mod h1:f/AR6r2DiSRK5zv9MD+NgWbayP6qDbQMw+unFuw0rPQ=
github.com/operator-framework/helm-operator-plugins v0.1.3 h1:nwl9K1Pq0NZmanpEF/DYO00S7QO/iAmEdRIuLROrYpk=
github.com/operator-framework/helm-operator-plugins v0.1.3/go.mod h1:f/AR6r2DiSRK5zv9MD+NgWbayP6qDbQMw+unFuw0rPQ=
github.com/operator-framework/operator-lib v0.12.0 h1:OzpMU5N7mvFgg/uje8FUUeD24Ahq64R6TdN25uswCYA=
github.com/operator-framework/operator-lib v0.12.0/go.mod h1:ClpLUI7hctEF7F5DBe/kg041dq/4NLR7XC5tArY7bG4=
github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI=
Expand Down

0 comments on commit e7ea4ea

Please sign in to comment.