[Project] get signing key from git config

This commit is contained in:
Robert von Burg 2021-07-14 16:28:27 +02:00
parent a3cc1163a3
commit fa3c2369b5
1 changed files with 3 additions and 2 deletions

View File

@ -19,10 +19,11 @@ if [ $# != 1 ] ; then
exit 1 exit 1
fi fi
gpgKeyName="$(git config --get user.signingkey)"
# Confirm # Confirm
releaseVersion=${1} releaseVersion=${1}
echo -e "INFO: Do you want to deploy version ${releaseVersion} to Maven Central? y/n" echo -e "INFO: Do you want to deploy version ${releaseVersion} to Maven Central, signing with ${gpgKeyName}? y/n"
read a read a
if [[ "${a}" != "y" && "${a}" != "Y" ]] ; then if [[ "${a}" != "y" && "${a}" != "Y" ]] ; then
exit 0; exit 0;
@ -58,7 +59,7 @@ trap cleanup EXIT
# Build and deploy # Build and deploy
echo -e "\nINFO: Building and deploying to Maven Central..." echo -e "\nINFO: Building and deploying to Maven Central..."
if ! mvn clean deploy -DskipTests -Pdeploy ; then if ! mvn clean deploy -DskipTests -Pdeploy -Dgpg.keyname=${gpgKeyName} ; then
echo -e "ERROR: Failed to build and deploy to Maven Central!" echo -e "ERROR: Failed to build and deploy to Maven Central!"
exit 1 exit 1
fi fi