Initial commit
This commit is contained in:
14
.github/scripts/commit-repo.sh
vendored
Executable file
14
.github/scripts/commit-repo.sh
vendored
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
rsync -a --delete --exclude .git --exclude .gitignore --exclude README.md ../main/repo/ .
|
||||
git config --global user.email "107297513+FourTOne5@users.noreply.github.com"
|
||||
git config --global user.name "FourTOne5"
|
||||
git status
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
git add .
|
||||
git commit -m "Update extensions repo"
|
||||
git push
|
||||
else
|
||||
echo "No changes to commit"
|
||||
fi
|
||||
66
.github/scripts/create-repo.sh
vendored
Executable file
66
.github/scripts/create-repo.sh
vendored
Executable file
@@ -0,0 +1,66 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
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" )
|
||||
|
||||
for APK in ${APKS[@]}; do
|
||||
FILENAME=$(basename ${APK})
|
||||
BADGING="$(${TOOLS}/aapt dump --include-meta-data badging $APK)"
|
||||
|
||||
PACKAGE=$(echo "$BADGING" | grep package:)
|
||||
PKGNAME=$(echo $PACKAGE | grep -Po "package: name='\K[^']+")
|
||||
VCODE=$(echo $PACKAGE | grep -Po "versionCode='\K[^']+")
|
||||
VNAME=$(echo $PACKAGE | grep -Po "versionName='\K[^']+")
|
||||
NSFW=$(echo $BADGING | grep -Po "tachiyomi.extension.nsfw' value='\K[^']+")
|
||||
HASREADME=$(echo $BADGING | grep -Po "tachiyomi.extension.hasReadme' value='\K[^']+")
|
||||
HASCHANGELOG=$(echo $BADGING | grep -Po "tachiyomi.extension.hasChangelog' value='\K[^']+")
|
||||
|
||||
APPLICATION=$(echo "$BADGING" | grep application:)
|
||||
LABEL=$(echo $APPLICATION | grep -Po "label='\K[^']+")
|
||||
|
||||
LANG=$(echo $APK | grep -Po "tachiyomi-\K[^\.]+")
|
||||
|
||||
ICON=$(echo "$BADGING" | grep -Po "application-icon-320.*'\K[^']+")
|
||||
unzip -p $APK $ICON > icon/${PKGNAME}.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" \
|
||||
--arg apk "$FILENAME" \
|
||||
--arg lang "$LANG" \
|
||||
--argjson code $VCODE \
|
||||
--arg version "$VNAME" \
|
||||
--argjson nsfw $NSFW \
|
||||
--argjson hasReadme $HASREADME \
|
||||
--argjson hasChangelog $HASCHANGELOG \
|
||||
--argjson sources "$SOURCE_INFO" \
|
||||
'{name:$name, pkg:$pkg, apk:$apk, lang:$lang, code:$code, version:$version, nsfw:$nsfw, hasReadme:$hasReadme, hasChangelog:$hasChangelog, sources:$sources}'
|
||||
|
||||
done | jq -sr '[.[]]' > index.json
|
||||
|
||||
# Alternate minified copy
|
||||
jq -c '.' < index.json > index.min.json
|
||||
|
||||
cat index.json
|
||||
26
.github/scripts/move-apks.sh
vendored
Executable file
26
.github/scripts/move-apks.sh
vendored
Executable 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