extensions-source/.github/scripts/move-apks.sh
2024-01-09 05:29:54 +06:00

27 lines
587 B
Bash
Executable File

#!/bin/bash
set -e
shopt -s globstar nullglob extglob
# 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 "100" ]; then
# echo "Insufficient amount of APKs found. Please check the project configuration."
# exit 1
#else
# echo "Moving ${#APKS[@]} APKs"
#fi
DEST=$PWD/apk
rm -rf $DEST && mkdir -p $DEST
for APK in ${APKS[@]}; do
BASENAME=$(basename $APK)
APKNAME="${BASENAME%%+(-release*)}.apk"
APKDEST="$DEST/$APKNAME"
cp $APK $APKDEST
done