From 44de26327405a74474ba59f8e6d5e3d93f4b277f Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Tue, 14 Jun 2022 15:21:16 +0530 Subject: [PATCH 1/8] Switch to Private Test Channel --- .github/tg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/tg.py b/.github/tg.py index 045443816..934f248c9 100644 --- a/.github/tg.py +++ b/.github/tg.py @@ -7,7 +7,7 @@ f = open('commit.json') data = load(f) f.close() -TG_CHAT_ID = "-1001537505605" +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* From da6db543c2e2814435f62a0fedeb627cfb059932 Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:57:59 +0530 Subject: [PATCH 2/8] Alpha Icon Patches --- .github/patch.py | 10 ++++++++++ .github/tg.py | 5 +---- .github/workflows/ci.yml | 5 ++++- .github/workflows/tg-bot.yml | 7 ++++--- 4 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 .github/patch.py 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 934f248c9..47e3a0552 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) @@ -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')) \ 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..bd42650a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 7ca78bb81..37fd0cc7a 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -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 From 993afc5210cd7f09a517a40e96dafdd10fff849a Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 20:59:23 +0530 Subject: [PATCH 3/8] Fix Actions Syntax --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/tg-bot.yml | 7 ++++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd42650a8..daab12250 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,10 +30,10 @@ jobs: cache: "gradle" - name: Patch and Compile - run: cd .github - run: python patch.py - run: ./gradlew assembleDebug - run: cd .. + run: | + cd .github + python patch.py + ./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 37fd0cc7a..35fa2350d 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -28,9 +28,10 @@ jobs: cache: "gradle" - name: Patch and Compile - run: cd .github - run: python patch.py - run: ./gradlew assembleDebug + run: | + cd .github + python patch.py + ./gradlew assembleDebug - name: Telegram Bot run: | From 3b49ba8ca0193063e1be4647d7f9edfdf8467934 Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:00:19 +0530 Subject: [PATCH 4/8] Fix Upload Path --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index daab12250..203329473 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,6 +34,7 @@ jobs: cd .github python patch.py ./gradlew assembleDebug + cd .. - name: Upload APK uses: actions/upload-artifact@v3 From e3a9cf206a772fbe712cfb1fee9c1b59ccc177e3 Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:09:00 +0530 Subject: [PATCH 5/8] Fix paths --- .github/workflows/ci.yml | 2 +- .github/workflows/tg-bot.yml | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 203329473..3300df239 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,8 +33,8 @@ jobs: run: | cd .github python patch.py - ./gradlew assembleDebug 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 35fa2350d..d7c63cf60 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -31,11 +31,13 @@ jobs: run: | cd .github python patch.py + cd .. ./gradlew assembleDebug - name: Telegram Bot run: | - mv ../app/build/outputs/apk/debug/*.apk . + mv ./app/build/outputs/apk/debug/*.apk . + cd .github 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 From f46b660732ce4bc55b99bb113a30fe20fd57c179 Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:42:43 +0530 Subject: [PATCH 6/8] Fix paths --- .github/workflows/tg-bot.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index d7c63cf60..ef6e1bbf9 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -36,7 +36,7 @@ jobs: - name: Telegram Bot run: | - mv ./app/build/outputs/apk/debug/*.apk . + 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 From b1f04cff42a29b0147a194cb838e6f3e06389ab1 Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:45:39 +0530 Subject: [PATCH 7/8] Add spacing to post --- .github/tg.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/tg.py b/.github/tg.py index 47e3a0552..999c8cc72 100644 --- a/.github/tg.py +++ b/.github/tg.py @@ -10,7 +10,9 @@ 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')) From 9504565697ed55d72f7102130acfa0166ed9728f Mon Sep 17 00:00:00 2001 From: XelXen <78258352+XelXen@users.noreply.github.com> Date: Wed, 15 Jun 2022 21:52:49 +0530 Subject: [PATCH 8/8] Main Channel --- .github/tg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/tg.py b/.github/tg.py index 999c8cc72..befaab722 100644 --- a/.github/tg.py +++ b/.github/tg.py @@ -6,7 +6,7 @@ f = open('commit.json') data = load(f) f.close() -TG_CHAT_ID = "-1001797185102" +TG_CHAT_ID = "-1001537505605" bot = telegram.Bot(TG_TOKEN) bot.send_photo(TG_CHAT_ID, open('alpha.png', 'rb'), f'''*Libretube {data['sha'][0:7]} // Alpha*