diff --git a/.github/actions/preparing/action.yml b/.github/actions/preparing/action.yml index 95c3236..e2c4d2e 100644 --- a/.github/actions/preparing/action.yml +++ b/.github/actions/preparing/action.yml @@ -9,4 +9,4 @@ runs: java-version: '17' - name: Setup Cloudflare Warp shell: bash - run: bash src/etc/cf_warp.sh + run: bash src/etc/cf_warp.sh \ No newline at end of file diff --git a/.github/actions/release/action.yml b/.github/actions/release/action.yml index 4492eb1..56b5963 100644 --- a/.github/actions/release/action.yml +++ b/.github/actions/release/action.yml @@ -19,10 +19,3 @@ runs: name: Revanced & Revanced Extended tag_name: all body_path: ${{ github.workspace }}-CHANGELOG.txt - - name: Delete workflow runs - uses: Mattraks/delete-workflow-runs@v2.0.6 - with: - token: ${{ github.token }} - repository: ${{ github.repository }} - retain_days: 90 - keep_minimum_runs: 999 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cc6520..cec2957 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,25 +13,35 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Check new patch ReVanced id: check-rv + if: steps.check-gh.outputs.internet_error == '0' run: bash src/etc/ci.sh ReVanced/revanced-patches latest youtube-revanced.apk - name: Check new patch ReVanced Beta id: check-rv-beta + if: steps.check-gh.outputs.internet_error == '0' run: bash src/etc/ci.sh ReVanced/revanced-patches prerelease youtube-beta-revanced.apk - name: Check new patch ReX id: check-rex + if: steps.check-gh.outputs.internet_error == '0' run: bash src/etc/ci.sh YT-Advanced/ReX-patches latest youtube-ReX.apk - name: Check new patch Revanced Extended id: check-rve + if: steps.check-gh.outputs.internet_error == '0' run: bash src/etc/ci.sh inotia00/revanced-patches latest youtube-revanced-extended.apk - name: Check new patch Revanced For Android 6 & 7 id: check-rve67 + if: steps.check-gh.outputs.internet_error == '0' run: bash src/etc/ci.sh kitadai31/revanced-patches-android6-7 latest youtube-revanced-extended-android-6-7.apk - name: Check new patch Revanced For Android 5 id: check-rve5 + if: steps.check-gh.outputs.internet_error == '0' run: bash src/etc/ci.sh d4n3436/revanced-patches-android5 latest youtube-revanced-extended-android-5.apk - name: Keep workflow run + if: steps.check-gh.outputs.internet_error == '0' uses: gautamkrishnar/keepalive-workflow@v1 outputs: check_rv: ${{ steps.check-rv.outputs.new_patch }} diff --git a/.github/workflows/manual-patch.yml b/.github/workflows/manual-patch.yml index 30ec617..91f58a0 100644 --- a/.github/workflows/manual-patch.yml +++ b/.github/workflows/manual-patch.yml @@ -38,13 +38,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Preparing to patch + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/preparing - name: Patch apk + if: steps.check-gh.outputs.internet_error == '0' run: bash src/build/Revanced-${{ matrix.Include.run }}.sh env: repository: ${{ github.repository }} - name: Releasing APK files + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/release patch_rv_beta: name: Patch Revanced Beta @@ -53,13 +59,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Preparing to patch + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/preparing - name: Patch apk + if: steps.check-gh.outputs.internet_error == '0' run: bash src/build/Revanced-Beta.sh env: repository: ${{ github.repository }} - name: Releasing APK files + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/release patch_rex: name: Patch ReX @@ -68,13 +80,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Preparing to patch + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/preparing - name: Patch apk + if: steps.check-gh.outputs.internet_error == '0' run: bash src/build/ReX.sh env: repository: ${{ github.repository }} - name: Releasing APK files + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/release patch_rve: name: Patch Revanced Extended @@ -83,13 +101,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Preparing to patch + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/preparing - name: Patch apk + if: steps.check-gh.outputs.internet_error == '0' run: bash src/build/Revanced-Extended.sh env: repository: ${{ github.repository }} - name: Releasing APK files + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/release patch_rve67: name: Revanced Extended Android 6,7 @@ -98,13 +122,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Preparing to patch + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/preparing - name: Patch apk + if: steps.check-gh.outputs.internet_error == '0' run: bash src/build/Revanced-Extended-Android-6-7.sh env: repository: ${{ github.repository }} - name: Releasing APK files + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/release patch_rve5: name: Revanced Extended Android 5 @@ -113,11 +143,17 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4.1.1 + - name: Check github connection + id: check-gh + run: bash src/etc/connection.sh - name: Preparing to patch + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/preparing - name: Patch apk + if: steps.check-gh.outputs.internet_error == '0' run: bash src/build/Revanced-Extended-Android-5.sh env: repository: ${{ github.repository }} - name: Releasing APK files + if: steps.check-gh.outputs.internet_error == '0' uses: ./.github/actions/release \ No newline at end of file diff --git a/src/etc/connection.sh b/src/etc/connection.sh new file mode 100644 index 0000000..45dacbc --- /dev/null +++ b/src/etc/connection.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +# Check github connection stable or not: +check_connection() { + wget -q $(curl -s "https://api.github.com/repos/revanced/revanced-patches/releases/latest" | jq -r '.assets[] | select(.name == "patches.json") | .browser_download_url') + if [ -f patches.json ]; then + echo "internet_error=0" >> $GITHUB_OUTPUT + echo -e "\e[32mGithub connection OK\e[0m" + else + echo "internet_error=1" >> $GITHUB_OUTPUT + echo -e "\e[31mGithub connection not stable!\e[0m" + fi +} +check_connection \ No newline at end of file