Files
Revanced-And-Revanced-Exten…/.github/workflows/patch.yml
2023-05-01 15:56:13 +07:00

177 lines
6.5 KiB
YAML

name: Patch Revanced & Revanced Extended
on:
workflow_dispatch:
jobs:
patch:
name: Patch Revanced & Revanced Extended
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up jdk
uses: actions/setup-java@v3.10.0
with:
distribution: 'zulu'
java-version: '17'
- name: Patch Youtube Revanced & Revanced Extended non-root
run: bash src/yt/patch.sh
- name: Patch Youtube Music Revanced & Revanced Extended non-root
run: bash src/ytm/patch.sh
- name: Patch Messenger Revanced
env:
GMAIL: ${{ secrets.GMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
run: |
echo "[google]
username = $GMAIL
password = $PASSWORD" >> ~/apkeep.ini
bash src/messenger/patch.sh
- name: Patch Tiktok Revanced
env:
GMAIL: ${{ secrets.GMAIL }}
PASSWORD: ${{ secrets.PASSWORD }}
run: |
echo "[google]
username = $GMAIL
password = $PASSWORD" >> ~/apkeep.ini
bash src/tiktok/patch.sh
- name: Patch Twitch Revanced
run: bash src/twitch/patch.sh
- name: Generate Changelog
run: |
curl -s https://api.github.com/repos/revanced/revanced-patches/releases/latest \
| grep "browser_download_url.*json" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
YTRVVERSION=$(jq -r '.[] | select(.name == "video-ads") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json)
rm -rf patches.json
curl -s https://api.github.com/repos/inotia00/revanced-patches/releases/latest \
| grep "browser_download_url.*json" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
YTRVEVERSION=$(jq -r '.[] | select(.name == "hide-general-ads") | .compatiblePackages[] | select(.name == "com.google.android.youtube") | .versions[-1]' patches.json)
rm -rf patches.json
curl -s https://api.github.com/repos/revanced/revanced-patches/releases/latest \
| grep "browser_download_url.*json" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -
YTMRVVERSION=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json)
YTMRVEVERSION=$(jq -r '.[] | select(.name == "hide-get-premium") | .compatiblePackages[] | select(.name == "com.google.android.apps.youtube.music") | .versions[-1]' patches.json)
rm -rf patches.json
echo "[Change Log](https://github.com/revanced/revanced-patches/releases/latest)
**Download Below** :point_down:
" > ${{ github.workspace }}-CHANGELOG-rv.txt
echo "[Change Log](https://github.com/inotia00/revanced-patches/releases/latest)
**Download Below** :point_down:
" > ${{ github.workspace }}-CHANGELOG-rve.txt
echo "INFO-YT-RV=Youtube Revanced v${YTRVVERSION}" >> $GITHUB_ENV
echo "INFO-YT-RVE=Youtube Revanced Extended v${YTRVEVERSION}" >> $GITHUB_ENV
echo "INFO-YTM-RV=Youtube Music Revanced v${YTMRVVERSION}" >> $GITHUB_ENV
echo "INFO-YTM-RVE=Youtube Music Revanced Extended v${YTMRVEVERSION}" >> $GITHUB_ENV
- uses: vishnudxb/cancel-workflow@v1.2
if: failure()
with:
repo: octocat/hello-world
workflow_id: ${{ github.run_id }}
access_token: ${{ github.token }}
- name: Delete Release
uses: dev-drprasad/delete-older-releases@v0.2.1
with:
repo: ${{ github.repository }}
keep_latest: 0
delete_tags: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Youtube Music Revanced
uses: softprops/action-gh-release@v1
with:
files: ytm-revanced.apk
name: ${{ env.INFO-YTM-RV }}
tag_name: YTM-Revanced
body_path: ${{ github.workspace }}-CHANGELOG-rv.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Youtube Music Revanced Extended
uses: softprops/action-gh-release@v1
with:
files: ytm-revanced-extended.apk
name: ${{ env.INFO-YTM-RVE }}
tag_name: YTM-Revanced-Extended
body_path: ${{ github.workspace }}-CHANGELOG-rve.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Youtube Revanced
uses: softprops/action-gh-release@v1
with:
files: yt-revanced.apk
name: ${{ env.INFO-YT-RV }}
tag_name: YT-Revanced
body_path: ${{ github.workspace }}-CHANGELOG-rv.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Youtube Revanced Extended
uses: softprops/action-gh-release@v1
with:
files: yt-revanced-extended.apk
name: ${{ env.INFO-YT-RVE }}
tag_name: YT-Revanced-Extended
body_path: ${{ github.workspace }}-CHANGELOG-rve.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Tiktok Revanced
uses: softprops/action-gh-release@v1
with:
files: Tiktok.apk
name: "Tiktok"
tag_name: Tiktok-Revanced
body_path: ${{ github.workspace }}-CHANGELOG-rv.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Twitch Revanced
uses: softprops/action-gh-release@v1
with:
files: Twitch.apk
name: "Twitch"
tag_name: Twitch-Revanced
body_path: ${{ github.workspace }}-CHANGELOG-rv.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release Facebook Messenger Revanced
uses: softprops/action-gh-release@v1
with:
files: Messenger.apk
name: "Facebook Messenger"
tag_name: Facebook-Messenger-Revanced
body_path: ${{ github.workspace }}-CHANGELOG-rv.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 5