Sign APKs in individual jobs

This commit is contained in:
arkon
2021-11-28 15:46:06 -05:00
parent 39b7fe8c4e
commit 2e21c8d1bb
4 changed files with 42 additions and 52 deletions

View File

@@ -1,18 +1,24 @@
#!/bin/bash
set -e
shopt -s globstar nullglob extglob
TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)"
mkdir -p repo/apk
mkdir -p repo/icon
cp -f apk/* repo/apk
cd repo
APKS=( ../apk/*".apk" )
APKS=( ../../apk/**/*".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
for APK in ${APKS[@]}; do
cp $APK ./apk
FILENAME=$(basename ${APK})
BADGING="$(${TOOLS}/aapt dump --include-meta-data badging $APK)"
@@ -31,7 +37,7 @@ for APK in ${APKS[@]}; do
unzip -p $APK $ICON > icon/${FILENAME%.*}.png
SOURCE_INFO=$(jq ".[\"$PKGNAME\"]" < ../output.json)
# Fixes the language code without needing to update the packages.
SOURCE_LEN=$(echo $SOURCE_INFO | jq length)

View File

@@ -4,17 +4,8 @@ shopt -s globstar nullglob extglob
TOOLS="$(ls -d ${ANDROID_HOME}/build-tools/* | tail -1)"
# Get APKs from previous jobs' artifacts
cp -R ~/apk-artifacts/ $PWD
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
else
echo "Signing ${#APKS[@]} APKs"
fi
echo "Signing ${#APKS[@]} APKs"
# Take base64 encoded key input and put it into a file
STORE_PATH=$PWD/signingkey.jks