New format

This commit is contained in:
XelXen 2022-06-12 23:11:49 +05:30 committed by GitHub
parent 96d37dc46a
commit cc1c6bd824
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

16
.github/tg.py vendored
View File

@ -1,10 +1,24 @@
import telegram
from tgconfig import TG_TOKEN
from json import load
from time import sleep
f = open('commit.json')
data = load(f)
title = f'''*Libretube {data['sha'][0:7]} // Alpha*
{data['commit']['message']}
Signed-off-by: {data['commit']['author']['name']} <{data['commit']['author']['email']}>
'''
f.close()
TG_CHAT_ID = "-1001537505605"
bot = telegram.Bot(TG_TOKEN)
bot.send_photo(TG_CHAT_ID, open('space.png', 'rb'))
bot.send_photo(TG_CHAT_ID, open('alpha.png', 'rb'), title, 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'))

View File

@ -34,8 +34,9 @@ jobs:
run: |
mv app/build/outputs/apk/debug/*.apk .github/
cd .github
curl https://libre-tube.github.io/assets/LibreSpace.png --output space.png
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
python -m pip install --upgrade pip
pip install python-telegram-bot
python tg.py