From eedee08c43ff4e04acff9feab2682b8aa0362e9f Mon Sep 17 00:00:00 2001 From: Bnyro Date: Thu, 12 Oct 2023 17:40:17 +0200 Subject: [PATCH] chore: remove telegram workflow --- .github/checkrun.py | 13 ------------- .github/tg.py | 34 ---------------------------------- .github/workflows/ci.yml | 16 ---------------- 3 files changed, 63 deletions(-) delete mode 100644 .github/checkrun.py delete mode 100644 .github/tg.py diff --git a/.github/checkrun.py b/.github/checkrun.py deleted file mode 100644 index d3ff65651..000000000 --- a/.github/checkrun.py +++ /dev/null @@ -1,13 +0,0 @@ -from json import load -from os import system - -with open("commit.json", "r") as f: - data = load(f)["commit"]["message"] - -if "\n\n" in data: - if data.split("\n\n", 1)[-1].split()[0] == "[SILENT]": - system("killall -9 python") - else: - print("Silence not found") -else: - print("Empty Description") diff --git a/.github/tg.py b/.github/tg.py deleted file mode 100644 index 77edb7b29..000000000 --- a/.github/tg.py +++ /dev/null @@ -1,34 +0,0 @@ -import asyncio -from json import load -from os import listdir - -from pyrogram import Client -from pyrogram.types import InputMediaDocument -from tgconfig import * - -files = listdir() - -mediadocuments = [ - InputMediaDocument(file) for file in files if file.endswith("signed.apk") -] - -with open("commit.json") as f: - data = load(f) - -caption = f"""**Libretube {data['sha'][0:7]} // Alpha** - -{data['commit']['message']} - -Signed-off-by: {data['commit']['author']['name']} -""" - - -async def main(): - async with Client("libretube", TG_API_ID, TG_API_HASH, bot_token=TG_TOKEN) as app: - await app.send_photo( - int(TG_POST_ID), "https://libre-tube.github.io/images/Alpha.png", caption - ) - await app.send_media_group(int(TG_POST_ID), mediadocuments) - - -asyncio.run(main()) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29dc657d4..909f2fd17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,6 @@ jobs: run: | cd .github curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json - python checkrun.py cd .. - name: Set up JDK 17 @@ -62,7 +61,6 @@ jobs: keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }} - - name: Upload to Archive continue-on-error: true run: | @@ -74,20 +72,6 @@ jobs: cd nightly python ../uploader.py - - name: Telegram Bot - continue-on-error: true - run: | - cd nightly - mv ../tgconfig.py . - echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" >> tgconfig.py - echo "TG_API_ID = '${{ secrets.TG_API_ID }}'" >> tgconfig.py - echo "TG_POST_ID = '${{ secrets.TG_POST_ID }}'" >> tgconfig.py - echo "TG_API_HASH = '${{ secrets.TG_API_HASH }}'" >> tgconfig.py - python -m pip install --upgrade pip TgCrypto Pyrogram - mv ../.github/tg.py . - mv ../.github/commit.json . - python tg.py - - name: Upload APK uses: actions/upload-artifact@v3 with: