merge upstream

This commit is contained in:
jmir1
2022-08-06 20:17:53 +02:00
parent bd076c3e5d
commit 0f7df7a71c
59 changed files with 1386 additions and 672 deletions

View File

@ -9,6 +9,9 @@ if [ -n "$(git status --porcelain)" ]; then
git add .
git commit -m "Update extensions repo"
git push
# Purge cached index on jsDelivr
curl https://purge.jsdelivr.net/gh/jmir1/aniyomi-extensions@repo/index.min.json
else
echo "No changes to commit"
fi

View File

@ -30,6 +30,19 @@ for APK in ${APKS[@]}; do
ICON=$(echo "$BADGING" | grep -Po "application-icon-320.*'\K[^']+")
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)
if [ $SOURCE_LEN = "1" ]; then
SOURCE_LANG=$(echo $SOURCE_INFO | jq -r '.[0].lang')
if [ $SOURCE_LANG != $LANG ] && [ $SOURCE_LANG != "all" ] && [ $SOURCE_LANG != "other" ] && [ $LANG != "all" ] && [ $LANG != "other" ]; then
LANG=$SOURCE_LANG
fi
fi
jq -n \
--arg name "$LABEL" \
--arg pkg "$PKGNAME" \
@ -45,7 +58,4 @@ done | jq -sr '[.[]]' > index.json
# Alternate minified copy
jq -c '.' < index.json > index.min.json
# Alternate gzipped copy
gzip -c index.json > index.json.gz
cat index.json

26
.github/scripts/move-apks.sh vendored Normal file
View File

@ -0,0 +1,26 @@
#!/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