diff --git a/.github/patch.py b/.github/patch.py new file mode 100644 index 000000000..c34d52002 --- /dev/null +++ b/.github/patch.py @@ -0,0 +1,10 @@ +from os import system + +patchRes = ["mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"] +for res in patchRes: + system(f"rm -rf ../app/src/main/res/mipmap-{res}/ic_launcher.png") + system(f"rm -rf ../app/src/main/res/mipmap-{res}/ic_launcher_foreground.png") + system(f"rm -rf ../app/src/main/res/mipmap-{res}/ic_launcher_round.png") + system(f"curl https://libre-tube.github.io/alpha-patch/mipmap-{res}/ic_launcher.png --output ../app/src/main/res/mipmap-{res}/ic_launcher.png") + system(f"curl https://libre-tube.github.io/alpha-patch/mipmap-{res}/ic_launcher_foreground.png --output ../app/src/main/res/mipmap-{res}/ic_launcher_foreground.png") + system(f"curl https://libre-tube.github.io/alpha-patch/mipmap-{res}/ic_launcher_round.png --output ../app/src/main/res/mipmap-{res}/ic_launcher_round.png") \ No newline at end of file diff --git a/.github/tg.py b/.github/tg.py index 045443816..befaab722 100644 --- a/.github/tg.py +++ b/.github/tg.py @@ -1,7 +1,6 @@ import telegram from tgconfig import TG_TOKEN from json import load -from time import sleep f = open('commit.json') data = load(f) @@ -19,4 +18,4 @@ Signed-off-by: {data['commit']['author']['name']} bot.send_document(TG_CHAT_ID, open('app-arm64-v8a-debug.apk', 'rb')) bot.send_document(TG_CHAT_ID, open('app-armeabi-v7a-debug.apk', 'rb')) bot.send_document(TG_CHAT_ID, open('app-x86_64-debug.apk', 'rb')) -bot.send_document(TG_CHAT_ID, open('app-x86-debug.apk', 'rb')) \ No newline at end of file +bot.send_document(TG_CHAT_ID, open('app-x86-debug.apk', 'rb')) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63af540b2..3300df239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,12 @@ jobs: distribution: "temurin" cache: "gradle" - - name: Build debug APK and run jvm tests - run: ./gradlew assembleDebug + - name: Patch and Compile + run: | + cd .github + python patch.py + cd .. + ./gradlew assembleDebug - name: Upload APK uses: actions/upload-artifact@v3 diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 7ca78bb81..ef6e1bbf9 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -27,12 +27,16 @@ jobs: distribution: "temurin" cache: "gradle" - - name: Build debug APK and run jvm tests - run: ./gradlew assembleDebug + - name: Patch and Compile + run: | + cd .github + python patch.py + cd .. + ./gradlew assembleDebug - name: Telegram Bot run: | - mv app/build/outputs/apk/debug/*.apk .github/ + mv ./app/build/outputs/apk/debug/*.apk .github/ cd .github curl https://libre-tube.github.io/assets/LibreAlpha.png --output alpha.png echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py