From 9751909e3255f1bbe452be53512b0f5445c82b1e Mon Sep 17 00:00:00 2001 From: Dmitry Nefedov Date: Wed, 31 Aug 2022 00:13:40 +0300 Subject: [PATCH] Update Build.yaml --- .github/workflows/Build.yaml | 158 +++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/.github/workflows/Build.yaml b/.github/workflows/Build.yaml index 8b13789..5ab05bd 100644 --- a/.github/workflows/Build.yaml +++ b/.github/workflows/Build.yaml @@ -1 +1,159 @@ +name: Build +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + patch: + runs-on: windows-latest + timeout-minutes: 5 + steps: + - uses: actions/checkout@main + - name: Downloading + run: | + # https://apkpure.com/youtube/com.google.android.youtube/versions + # YouTube 17.33.42 + $Parameters = @{ + Uri = "https://apkpure.com/youtube/com.google.android.youtube/download/1531188672-APK-1d33a9dd6b47ec963ea80d2437ef7d3f" + UseBasicParsing = $true + Verbose = $true + } + $URL = ((Invoke-Webrequest @Parameters).Links | Where-Object -FilterScript {$_.href -match "https://download.apkpure.com"}).href + $Parameters = @{ + Uri = $URL + Outfile = "$PSScriptRoot\youtube.apk" + UseBasicParsing = $true + Verbose = $true + } + Invoke-Webrequest @Parameters + + # https://github.com/revanced/revanced-cli + $Parameters = @{ + Uri = "https://api.github.com/repos/revanced/revanced-cli/releases/latest" + UseBasicParsing = $true + Verbose = $true + } + $Tag = (Invoke-RestMethod @Parameters).tag_name + $Tag2 = $Tag.replace("v", "") + $Parameters = @{ + Uri = "https://github.com/revanced/revanced-cli/releases/download/$Tag/revanced-cli-$Tag2-all.jar" + Outfile = "$PSScriptRoot\revanced-cli.jar" + UseBasicParsing = $true + Verbose = $true + } + Invoke-RestMethod @Parameters + + # https://github.com/revanced/revanced-patches + $Parameters = @{ + Uri = "https://api.github.com/repos/revanced/revanced-patches/releases/latest" + UseBasicParsing = $true + Verbose = $true + } + $Tag = (Invoke-RestMethod @Parameters).tag_name + $Tag2 = $Tag.replace("v", "") + $Parameters = @{ + Uri = "https://github.com/revanced/revanced-patches/releases/download/$Tag/revanced-patches-$Tag2.jar" + Outfile = "$PSScriptRoot\revanced-patches.jar" + UseBasicParsing = $true + Verbose = $true + } + Invoke-RestMethod @Parameters + + # https://github.com/revanced/revanced-integrations + $Parameters = @{ + Uri = "https://api.github.com/repos/revanced/revanced-integrations/releases/latest" + UseBasicParsing = $true + Verbose = $true + } + $Tag = (Invoke-RestMethod @Parameters).tag_name + $Parameters = @{ + Uri = "https://github.com/revanced/revanced-integrations/releases/download/$Tag/app-release-unsigned.apk" + Outfile = "$PSScriptRoot\app-release-unsigned.apk" + UseBasicParsing = $true + Verbose = $true + } + Invoke-RestMethod @Parameters + + # https://apkpure.com/vanced-microg/com.mgoogle.android.gms + $Parameters = @{ + Uri = "https://apkpure.com/vanced-microg/com.mgoogle.android.gms/download?from=details" + UseBasicParsing = $true + Verbose = $true + } + $URL = ((Invoke-Webrequest @Parameters).Links | Where-Object -FilterScript {$_.href -match "https://download.apkpure.com"}).href + $Parameters = @{ + Uri = $URL + Outfile = "$PSScriptRoot\microg.apk" + UseBasicParsing = $true + Verbose = $true + } + Invoke-Webrequest @Parameters + + # https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json + $Parameters = @{ + Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json" + UseBasicParsing = $true + Verbose = $true + } + $URL = (Invoke-RestMethod @Parameters).architecture."64bit".url + $Parameters = @{ + Uri = $URL + Outfile = "$PSScriptRoot\jdk_windows-x64_bin.zip" + UseBasicParsing = $true + Verbose = $true + } + Invoke-RestMethod @Parameters + + # Expand jdk_windows-x64_bin archive + $Parameters = @{ + Path = "$PSScriptRoot\jdk_windows-x64_bin.zip" + DestinationPath = "$PSScriptRoot\jdk_windows-x64_bin" + Force = $true + Verbose = $true + } + Expand-Archive @Parameters + + Remove-Item -Path "$PSScriptRoot\jdk_windows-x64_bin.zip" -Force + + - name: Sophia Script for Windows 10 + run: | + # https://github.com/revanced/revanced-patches + & "$PSScriptRoot\jdk_windows-x64_bin\zulu*win_x64\bin\java.exe" ` + -jar "$PSScriptRoot\revanced-cli.jar" ` + --apk "$PSScriptRoot\youtube.apk" ` + --bundles "$PSScriptRoot\revanced-patches.jar" ` + --merge "$PSScriptRoot\app-release-unsigned.apk" ` + --exclude timeline-ads ` + --exclude premium-icon-reddit ` + --exclude general-reddit-ads ` + --exclude pflotsh-ecmwf-subscription-unlock ` + --exclude minimized-playback-music --exclude tasteBuilder-remover --exclude hide-get-premium --exclude compact-header --exclude upgrade-button-remover --exclude background-play --exclude music-microg-support --exclude music-video-ads --exclude codecs-unlock --exclude exclusive-audio-playback ` + --exclude promo-code-unlock ` + --exclude tiktok-ads ` + --exclude swipe-controls --exclude downloads --exclude amoled --exclude hide-autoplay-button --exclude premium-heading --exclude disable-fullscreen-panels --exclude old-quality-layout --exclude enable-wide-searchbar --exclude tablet-mini-player --exclude always-autorepeat --exclude enable-debugging --exclude custom-playback-speed --exclude hide-infocard-suggestions ` + --clean ` + --temp-dir "$PSScriptRoot\Temp" ` + --out "$PSScriptRoot\revanced.apk" + + $Parameters = @{ + Path = "$PSScriptRoot\revanced.apk", "$PSScriptRoot\microg.apk" + DestinationPath = "ReVanced.zip" + CompressionLevel = "Fastest" + Force = $true + } + Compress-Archive @Parameters + + - name: Upload ReVanced.zip to release + uses: svenstaro/upload-release-action@master + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ReVanced.zip + tag: ${{ github.ref }} + overwrite: true + file_glob: true + prerelease: true