diff --git a/.github/uploader.py b/.github/uploader.py new file mode 100644 index 000000000..a0cd08e12 --- /dev/null +++ b/.github/uploader.py @@ -0,0 +1,15 @@ +from os import system as run +import tgconfig + +if tgconfig.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") + run("cd ..") +else: + run("mkdir archive") + run("mv app/build/outputs/apk/debug/*.apk archive/") \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65597baf2..789c5d348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: distribution: "temurin" cache: "gradle" - - name: Prepare for Compilation + - name: Git Configuraion run: | git config --global user.name "alefvanoon" git config --global user.email "53198048+alefvanoon@users.noreply.github.com" @@ -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