From 292b94ca21743cca13b4be6d003e34d9a865d7e5 Mon Sep 17 00:00:00 2001
From: arkon <eugcheung94@gmail.com>
Date: Tue, 15 Dec 2020 22:48:35 -0500
Subject: [PATCH] Fail CI build if not enough APKs were built

---
 .github/scripts/sign-apks.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/.github/scripts/sign-apks.sh b/.github/scripts/sign-apks.sh
index af7ec544e..491219f2f 100755
--- a/.github/scripts/sign-apks.sh
+++ b/.github/scripts/sign-apks.sh
@@ -6,6 +6,12 @@ TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)"
 shopt -s globstar nullglob extglob
 APKS=( **/*".apk" )
 
+# Fail if too little extensions seem to have been built
+if [ "${#APKS[@]}" -le "1" ]; then
+    echo "Insufficient amount of APKs found. Please check the project configuration."
+    exit 1;
+fi;
+
 # Take base64 encoded key input and put it into a file
 STORE_PATH=$PWD/signingkey.jks
 rm -f $STORE_PATH && touch $STORE_PATH