diff --git a/.github/tg.py b/.github/tg.py new file mode 100644 index 000000000..e3b14d5a9 --- /dev/null +++ b/.github/tg.py @@ -0,0 +1,11 @@ +import telegram +from tgconfig import TG_TOKEN + +TG_CHAT_ID = "-1001537505605" +bot = telegram.Bot(TG_TOKEN, base_url="http://0.0.0.0:8081/bot") + +bot.send_photo(TG_CHAT_ID, open('space.png', 'rb')) +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')) +bot.send_document(TG_CHAT_ID, open('app-x86-debug.apk', 'rb')) \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63af540b2..3e82b90cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,9 +18,16 @@ on: jobs: debug-builds: runs-on: ubuntu-latest + container: + image: ghcr.io/xelxen/build:ubuntu + steps: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 + - 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: set up JDK 11 uses: actions/setup-java@v3 @@ -37,3 +44,15 @@ jobs: with: name: app path: app/build/outputs/apk/debug/*.apk + + - name: Telegram Bot + 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://raw.githubusercontent.com/LibreTubeAlpha/Telegram-BotAPI-CI/main/build/telegram-bot-api --output bot-api + echo "TG_TOKEN = '${{ secrets.TG_TOKEN }}'" > tgconfig.py + python -m pip install --upgrade pip + pip install python-telegram-bot + ./bot-api --api-id=${{ secrets.API_ID }} --api-hash=${{ secrets.API_HASH }} + python tg.py