mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-29 08:20:32 +05:30
Build Bot API
This commit is contained in:
parent
43f3cd0c2b
commit
1218eb53d5
14
.github/tg.py
vendored
14
.github/tg.py
vendored
@ -1,21 +1,21 @@
|
|||||||
import telegram
|
import telegram
|
||||||
from tgconfig import TG_TOKEN
|
from tgconfig import *
|
||||||
from json import load
|
from json import load
|
||||||
|
|
||||||
f = open('commit.json')
|
f = open('commit.json')
|
||||||
data = load(f)
|
data = load(f)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
TG_CHAT_ID = "-1001537505605"
|
TG_POST_ID = "-1001537505605"
|
||||||
bot = telegram.Bot(TG_TOKEN)
|
bot = telegram.Bot(TG_TOKEN)
|
||||||
|
|
||||||
bot.send_photo(TG_CHAT_ID, open('alpha.png', 'rb'), f'''*Libretube {data['sha'][0:7]} // Alpha*
|
bot.send_photo(TG_POST_ID, open('alpha.png', 'rb'), f'''*Libretube {data['sha'][0:7]} // Alpha*
|
||||||
|
|
||||||
{data['commit']['message']}
|
{data['commit']['message']}
|
||||||
|
|
||||||
Signed-off-by: {data['commit']['author']['name']}
|
Signed-off-by: {data['commit']['author']['name']}
|
||||||
''', parse_mode=telegram.ParseMode.MARKDOWN)
|
''', parse_mode=telegram.ParseMode.MARKDOWN)
|
||||||
bot.send_document(TG_CHAT_ID, open('app-arm64-v8a-debug.apk', 'rb'))
|
bot.send_document(TG_POST_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_POST_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_POST_ID, open('app-x86_64-debug.apk', 'rb'))
|
||||||
bot.send_document(TG_CHAT_ID, open('app-x86-debug.apk', 'rb'))
|
bot.send_document(TG_POST_ID, open('app-x86-debug.apk', 'rb'))
|
||||||
|
41
.github/workflows/api-compiler.yml
vendored
Normal file
41
.github/workflows/api-compiler.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: Bot API Compiler
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
debug-builds:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Prepare for Compilation
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade
|
||||||
|
sudo apt-get install make git zlib1g-dev libssl-dev gperf cmake g++
|
||||||
|
git config --global user.name "XelXen"
|
||||||
|
git config --global user.email "78258352+XelXen@users.noreply.github.com"
|
||||||
|
git config --global credential.helper store
|
||||||
|
echo "https://XelXen:${{ secrets.GH_TOKEN }}@github.com" > ~/.git-credentials
|
||||||
|
git clone --recursive https://github.com/tdlib/telegram-bot-api.git
|
||||||
|
cd telegram-bot-api
|
||||||
|
rm -rf build
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
|
||||||
|
- name: Patch and Compile
|
||||||
|
run: |
|
||||||
|
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX:PATH=.. ..
|
||||||
|
cmake --build . --target install
|
||||||
|
|
||||||
|
- name: Binary Archive
|
||||||
|
run: |
|
||||||
|
cd ../..
|
||||||
|
git clone https://github.com/LibreTubeAlpha/Telegram-BotAPI bot-api
|
||||||
|
rm -rf bot-api/*
|
||||||
|
mv ./telegram-bot-api/bin/telegram-bot-api ./bot-api/exec
|
||||||
|
cd bot-api
|
||||||
|
git add -f *
|
||||||
|
git commit -m "WORKFLOW: BUILD BINARIES"
|
||||||
|
git push -u
|
6
.github/workflows/tg-bot.yml
vendored
6
.github/workflows/tg-bot.yml
vendored
@ -1,4 +1,4 @@
|
|||||||
name: Telegram Builder
|
name: Telegram Bot
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@ -39,7 +39,11 @@ jobs:
|
|||||||
mv ./app/build/outputs/apk/debug/*.apk .github/
|
mv ./app/build/outputs/apk/debug/*.apk .github/
|
||||||
cd .github
|
cd .github
|
||||||
curl https://libre-tube.github.io/assets/LibreAlpha.png --output alpha.png
|
curl https://libre-tube.github.io/assets/LibreAlpha.png --output alpha.png
|
||||||
|
curl https://raw.githubusercontent.com/LibreTubeAlpha/Telegram-BotAPI/main/bin/telegram-bot-api --output bot-api
|
||||||
echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py
|
echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py
|
||||||
|
echo "TG_POST_ID = '${{ secrets.TG_POST_ID }}'" >> tgconfig.py
|
||||||
|
echo "TG_API_ID = '${{ secrets.TG_API_ID }}'" >> tgconfig.py
|
||||||
|
echo "TG_API_HASH = '${{ secrets.TG_API_HASH }}'" >> tgconfig.py
|
||||||
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
|
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
|
||||||
python -m pip install --upgrade pip
|
python -m pip install --upgrade pip
|
||||||
pip install python-telegram-bot
|
pip install python-telegram-bot
|
||||||
|
Loading…
x
Reference in New Issue
Block a user