mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-13 05:40:31 +05:30
chore: remove telegram workflow
This commit is contained in:
parent
3940de2cd2
commit
eedee08c43
13
.github/checkrun.py
vendored
13
.github/checkrun.py
vendored
@ -1,13 +0,0 @@
|
|||||||
from json import load
|
|
||||||
from os import system
|
|
||||||
|
|
||||||
with open("commit.json", "r") as f:
|
|
||||||
data = load(f)["commit"]["message"]
|
|
||||||
|
|
||||||
if "\n\n" in data:
|
|
||||||
if data.split("\n\n", 1)[-1].split()[0] == "[SILENT]":
|
|
||||||
system("killall -9 python")
|
|
||||||
else:
|
|
||||||
print("Silence not found")
|
|
||||||
else:
|
|
||||||
print("Empty Description")
|
|
34
.github/tg.py
vendored
34
.github/tg.py
vendored
@ -1,34 +0,0 @@
|
|||||||
import asyncio
|
|
||||||
from json import load
|
|
||||||
from os import listdir
|
|
||||||
|
|
||||||
from pyrogram import Client
|
|
||||||
from pyrogram.types import InputMediaDocument
|
|
||||||
from tgconfig import *
|
|
||||||
|
|
||||||
files = listdir()
|
|
||||||
|
|
||||||
mediadocuments = [
|
|
||||||
InputMediaDocument(file) for file in files if file.endswith("signed.apk")
|
|
||||||
]
|
|
||||||
|
|
||||||
with open("commit.json") as f:
|
|
||||||
data = load(f)
|
|
||||||
|
|
||||||
caption = f"""**Libretube {data['sha'][0:7]} // Alpha**
|
|
||||||
|
|
||||||
<a href="{data['html_url']}">{data['commit']['message']}</a>
|
|
||||||
|
|
||||||
Signed-off-by: {data['commit']['author']['name']}
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
async def main():
|
|
||||||
async with Client("libretube", TG_API_ID, TG_API_HASH, bot_token=TG_TOKEN) as app:
|
|
||||||
await app.send_photo(
|
|
||||||
int(TG_POST_ID), "https://libre-tube.github.io/images/Alpha.png", caption
|
|
||||||
)
|
|
||||||
await app.send_media_group(int(TG_POST_ID), mediadocuments)
|
|
||||||
|
|
||||||
|
|
||||||
asyncio.run(main())
|
|
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -30,7 +30,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
cd .github
|
cd .github
|
||||||
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 checkrun.py
|
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
- name: Set up JDK 17
|
- name: Set up JDK 17
|
||||||
@ -62,7 +61,6 @@ jobs:
|
|||||||
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
keyStorePassword: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||||
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
keyPassword: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
||||||
|
|
||||||
|
|
||||||
- name: Upload to Archive
|
- name: Upload to Archive
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
@ -74,20 +72,6 @@ jobs:
|
|||||||
cd nightly
|
cd nightly
|
||||||
python ../uploader.py
|
python ../uploader.py
|
||||||
|
|
||||||
- name: Telegram Bot
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
cd nightly
|
|
||||||
mv ../tgconfig.py .
|
|
||||||
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 TgCrypto Pyrogram
|
|
||||||
mv ../.github/tg.py .
|
|
||||||
mv ../.github/commit.json .
|
|
||||||
python tg.py
|
|
||||||
|
|
||||||
- name: Upload APK
|
- name: Upload APK
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
Loading…
Reference in New Issue
Block a user