LibreTube/.github/workflows/tg-bot.yml
2022-09-18 10:48:30 +05:30

49 lines
1.6 KiB
YAML

name: Telegram Bot
on:
workflow_dispatch:
push:
paths-ignore:
- "README*.md"
- "fastlane/**"
- "assets/**"
- ".github/**/*.md"
jobs:
debug-builds:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
architecture: 'x64' # optional x64 or x86. Defaults to x64 if not specified
- name: Check for Execution Orders
run: |
cd .github
curl https://api.github.com/repos/${{ github.repository }}/commits/${{ github.sha }} > commit.json
python checkrun.py
cd ..
- name: Download packages
run: |
cd .github
python pkg.py
cd ..
- name: Telegram Bot
continue-on-error: true
run: |
cd .github
curl https://libre-tube.github.io/images/LibreAlpha.png --output alpha.png
curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/exec --output bot-api
chmod 755 ./bot-api
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
pip install python-telegram-bot
python tg.py