merge upstream
This commit is contained in:
3
.github/scripts/commit-repo.sh
vendored
3
.github/scripts/commit-repo.sh
vendored
@ -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
|
||||
|
16
.github/scripts/create-repo.sh
vendored
16
.github/scripts/create-repo.sh
vendored
@ -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
26
.github/scripts/move-apks.sh
vendored
Normal 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
|
Reference in New Issue
Block a user