diff --git a/.github/pkg.py b/.github/pkg.py new file mode 100644 index 000000000..7cc4fc63d --- /dev/null +++ b/.github/pkg.py @@ -0,0 +1,25 @@ +import subprocess + +while True: + outputStr = subprocess.call("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86-debug.apk --output ~/app-x86-debug.apk", shell=True) + if "Not Found" not in outputStr: + print("Build [x86] Downloaded") + break + +while True: + outputStr = subprocess.call("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-x86_64-debug.apk --output ~/app-x86_64-debug.apk", shell=True) + if "Not Found" not in outputStr: + print("Build [x86_64] Downloaded") + break + +while True: + outputStr = subprocess.call("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-armeabi-v7a-debug.apk --output ~/app-armeabi-v7a-debug.apk", shell=True) + if "Not Found" not in outputStr: + print("Build [arm7] Downloaded") + break + +while True: + outputStr = subprocess.call("curl https://raw.githubusercontent.com/LibreTubeAlpha/Archive/main/latestBuild/app-armeabi-v8a-debug.apk --output ~/app-armeabi-v8a-debug.apk", shell=True) + if "Not Found" not in outputStr: + print("Build [arm8] Downloaded") + break \ No newline at end of file diff --git a/.github/workflows/api-compiler.yml b/.github/workflows/api-compiler.yml index 176c2d079..850ab5a6a 100644 --- a/.github/workflows/api-compiler.yml +++ b/.github/workflows/api-compiler.yml @@ -21,10 +21,10 @@ jobs: chmod 755 .github/compiler.sh .github/compiler.sh - - name: Binary Archive + - name: Upload to Archive run: | - git clone https://github.com/LibreTubeAlpha/Telegram-BotAPI bot-api - rm -rf bot-api/* + git clone https://github.com/LibreTubeAlpha/Archive bot-api + rm -rf bot-api/exec mv ~/telegram-bot-api/bin/telegram-bot-api bot-api/exec cd bot-api git add -f * diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3300df239..e9d2d4f35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,13 +22,27 @@ jobs: - uses: actions/checkout@v3 - uses: gradle/wrapper-validation-action@v1 - - name: set up JDK 11 + - 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: Set up JDK 11 uses: actions/setup-java@v3 with: java-version: 11 distribution: "temurin" cache: "gradle" + - name: Prepare for Compilation + run: | + git config --global user.name "XelXen" + git config --global user.email "78258352+XelXen@users.noreply.github.com" + git config --global credential.helper store + echo "https://XelXen:${{ secrets.GH_TOKEN }}@github.com" > ~/.git-credentials + - name: Patch and Compile run: | cd .github @@ -36,8 +50,19 @@ jobs: cd .. ./gradlew assembleDebug + - name: Upload to Archive + 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 + cd .. + - name: Upload APK uses: actions/upload-artifact@v3 with: name: app - path: app/build/outputs/apk/debug/*.apk + path: archive/*.apk diff --git a/.github/workflows/tg-bot.yml b/.github/workflows/tg-bot.yml index 9f142fec7..6a911834b 100644 --- a/.github/workflows/tg-bot.yml +++ b/.github/workflows/tg-bot.yml @@ -14,7 +14,6 @@ jobs: runs-on: ubuntu-latest 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 @@ -27,28 +26,19 @@ jobs: python checkrun.py cd .. - - name: set up JDK 11 - uses: actions/setup-java@v3 - with: - java-version: 11 - distribution: "temurin" - cache: "gradle" - - - name: Patch and Compile + - name: Download packages run: | cd .github - python patch.py + python pkg.py cd .. - ./gradlew assembleDebug - name: Telegram Bot continue-on-error: true run: | - mv ./app/build/outputs/apk/debug/*.apk .github/ - cd .github + cd ~ curl https://libre-tube.github.io/images/LibreAlpha.png --output alpha.png - curl https://raw.githubusercontent.com/LibreTubeAlpha/Telegram-BotAPI/main/exec --output ~/bot-api - chmod 755 ~/bot-api + 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