Alpha Icon Patches

This commit is contained in:
XelXen 2022-06-15 20:57:59 +05:30 committed by GitHub
parent e12d30fdb9
commit da6db543c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 8 deletions

10
.github/patch.py vendored Normal file
View File

@ -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")

5
.github/tg.py vendored
View File

@ -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)
@ -11,12 +10,10 @@ TG_CHAT_ID = "-1001797185102"
bot = telegram.Bot(TG_TOKEN)
bot.send_photo(TG_CHAT_ID, open('alpha.png', 'rb'), f'''*Libretube {data['sha'][0:7]} // Alpha*
{data['commit']['message']}
Signed-off-by: {data['commit']['author']['name']}
''', parse_mode=telegram.ParseMode.MARKDOWN)
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'))
bot.send_document(TG_CHAT_ID, open('app-x86-debug.apk', 'rb'))

View File

@ -29,8 +29,11 @@ jobs:
distribution: "temurin"
cache: "gradle"
- name: Build debug APK and run jvm tests
- name: Patch and Compile
run: cd .github
run: python patch.py
run: ./gradlew assembleDebug
run: cd ..
- name: Upload APK
uses: actions/upload-artifact@v3

View File

@ -27,13 +27,14 @@ jobs:
distribution: "temurin"
cache: "gradle"
- name: Build debug APK and run jvm tests
- name: Patch and Compile
run: cd .github
run: python patch.py
run: ./gradlew assembleDebug
- name: Telegram Bot
run: |
mv app/build/outputs/apk/debug/*.apk .github/
cd .github
mv ../app/build/outputs/apk/debug/*.apk .
curl https://libre-tube.github.io/assets/LibreAlpha.png --output alpha.png
echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json