chore: remove telegram workflow

This commit is contained in:
Bnyro 2023-10-12 17:40:17 +02:00
parent 3940de2cd2
commit eedee08c43
3 changed files with 0 additions and 63 deletions

13
.github/checkrun.py vendored
View File

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

34
.github/tg.py vendored
View File

@ -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**
<a href="{data['html_url']}">{data['commit']['message']}</a>
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())

View File

@ -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: