Add misc repo check for git uploads

This commit is contained in:
XelXen 2022-09-21 19:34:55 +05:30 committed by GitHub
parent 70f131a70e
commit 0c873aa10b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 8 deletions

11
.github/uploader.py vendored Normal file
View File

@ -0,0 +1,11 @@
from os import system as run
import tgconfig
if GH_REPO.lower() == "libre-tube/libretube":
run("git clone https://github.com/LibreTubeAlpha/Archive archive")
run("rm -rf archive/*.apk")
run("mv app/build/outputs/apk/debug/*.apk archive/")
run("cd archive")
run("git add -f *")
run('git commit -m "WORKFLOW: ALPHA BUILDS"')
run("git push -u")

View File

@ -57,13 +57,9 @@ jobs:
- name: Upload to Archive
continue-on-error: true
run: |
git clone https://github.com/LibreTubeAlpha/Archive archive
rm -rf archive/*.apk
mv app/build/outputs/apk/debug/*.apk archive/
cd archive
git add -f *
git commit -m "WORKFLOW: ALPHA BUILDS"
git push -u
mv .github/uploader.py .
echo "GH_REPO = '${{ github.repository }}'" > tgconfig.py
python uploader.py
- name: Telegram Bot
continue-on-error: true
@ -72,7 +68,8 @@ jobs:
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
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