mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 07:50:31 +05:30
New format
This commit is contained in:
parent
96d37dc46a
commit
cc1c6bd824
16
.github/tg.py
vendored
16
.github/tg.py
vendored
@ -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'))
|
||||
|
3
.github/workflows/tg-bot.yml
vendored
3
.github/workflows/tg-bot.yml
vendored
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user