Feat: Add support for signing packages
Some checks reported errors
continuous-integration/drone/tag Build was killed

This commit is contained in:
Dorian Zedler 2022-08-04 17:24:53 +02:00
parent b94f9727ad
commit d39a03c789
Signed by: dorian
GPG key ID: 989DE36109AFA354

View file

@ -4,11 +4,15 @@ set -e
[[ -z "${PLUGIN_QMAKE_ARGUMENTS}" ]] && QMAKE_ARGUMENTS=$1 || QMAKE_ARGUMENTS="${PLUGIN_QMAKE_ARGUMENTS}"
[[ -z "${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}" ]] && ANDROIDDEPLOYQT_ARGUMENTS=$2 || ANDROIDDEPLOYQT_ARGUMENTS="${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
[[ -z "${PLUGIN_SRC_DIR}" ]] && SRC_DIR=$(pwd) || SRC_DIR=$(realpath "${PLUGIN_SRC_DIR}")
[[ -z "${PLUGIN_ANDROID_KEYSTORE_PATH}" ]] && ANDROID_KEYSTORE_PATH=$3 || ANDROID_KEYSTORE_PATH=$(realpath "${PLUGIN_ANDROID_KEYSTORE_PATH}")
[[ -z "${PLUGIN_ANDROID_KEYSTORE_ALIAS}" ]] && ANDROID_KEYSTORE_ALIAS=$4 || ANDROID_KEYSTORE_ALIAS="${PLUGIN_ANDROID_KEYSTORE_ALIAS}"
[[ -z "${PLUGIN_ANDROID_KEYSTORE_STORE_PASS}" ]] && ANDROID_KEYSTORE_STORE_PASS=$5 || ANDROID_KEYSTORE_STORE_PASS="${PLUGIN_ANDROID_KEYSTORE_STORE_PASS}"
echo "**** environment: ****"
echo "* QMAKE_ARGUMENTS=${QMAKE_ARGUMENTS}"
echo "* ANDROIDDEPLOYQT_ARGUMENTS=${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
echo "* ANDROIDDEPLOYQT_ARGUMENTS=${ANDROIDDEPLOYQT_ARGUMENTS}"
echo "* SRC_DIR=${SRC_DIR}"
echo "* ANDROID_KEYSTORE_PATH=${ANDROID_KEYSTORE_PATH}"
echo "**********************"
echo ""
echo "**** prepare ****"
@ -24,7 +28,15 @@ make -j8
make INSTALL_ROOT=/build/android-build install
echo "**** android build ****"
androiddeployqt --input $(ls -1 /build/android-*-deployment-settings.json) --output /build/android-build --gradle $ANDROIDDEPLOYQT_ARGUMENTS
# inject signing stuff
if [ -n "$ANDROID_KEYSTORE_PATH" ] && [ -n "$ANDROID_KEYSTORE_ALIAS" ]; then
ANDROIDDEPLOYQT_ARGUMENTS="$ANDROIDDEPLOYQT_ARGUMENTS --sign $ANDROID_KEYSTORE_PATH $ANDROID_KEYSTORE_ALIAS"
if [ -n "$ANDROID_KEYSTORE_STORE_PASS" ]; then
ANDROIDDEPLOYQT_ARGUMENTS="$ANDROIDDEPLOYQT_ARGUMENTS --storepass $ANDROID_KEYSTORE_STORE_PASS"
fi
fi
androiddeployqt --input $(ls -1 /build/android-*-deployment-settings.json) --output /build/android-build $ANDROIDDEPLOYQT_ARGUMENTS
echo "**** finish up ****"
mv /build/android-build//build/outputs $SRC_DIR/outputs