Files
ReVanced_Builder/.github/workflows/Build.yml
2022-09-23 00:40:40 +03:00

107 lines
4.3 KiB
YAML

name: Build
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
patch:
runs-on: windows-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@main
- name: Installing AngleSharp
run: |
# https://github.com/AngleSharp/AngleSharp
Install-Package AngleSharp -Source https://www.nuget.org/api/v2 -SkipDependencies -Force
- name: Downloading YouTube
run: |
. Scripts\YouTube.ps1
- name: Downloading ReVanced CLI
run: |
. Scripts\ReVanced_CLI.ps1
- name: Downloading ReVanced Patches
run: |
. Scripts\ReVanced_Patches.ps1
- name: Downloading ReVanced Integrations
run: |
. Scripts\ReVanced_Intergrations.ps1
- name: Downloading Vanced MicroG
run: |
. Scripts\MicroG.ps1
- name: Downloading latest Zulu JDK
run: |
. Scripts\Zulu_JDK.ps1
- name: Expanding Zulu JDK
run: |
# 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: Building
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-download --exclude tiktok-seekbar --exclude tiktok-ads `
--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"
- name: Creating archive
run: |
$Parameters = @{
Path = "$PSScriptRoot\revanced.apk", "$PSScriptRoot\microg.apk"
DestinationPath = "ReVanced.zip"
CompressionLevel = "Fastest"
Force = $true
}
Compress-Archive @Parameters
- name: ReleaseNotesTemplate
id: read_release
run: |
# https://en.wikipedia.org/wiki/Percent-encoding
$Release = (Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("`n", "%0A").replace("`r", "%0D").replace("YouTubeTag", "${{ env.LatestSupported }}").replace("CLITag", "${{ env.CLIvtag }}").replace("PatchesTag", "${{ env.Patchesvtag }}").replace("IntegrationsTag", "${{ env.IntegrationsTag }}").replace("MicroGTag", "${{ env.MicroGTag }}").replace("ZuluTag", "${{ env.ZuluTag }}")
# https://trstringer.com/github-actions-multiline-strings/
echo "::set-output name=RELEASE_BODY::$Release"
$ReleaseName = Get-Date -f "yyyy.MM.dd"
echo "RELEASE_NAME=$ReleaseName" >> $env:GITHUB_ENV
- name: Uploading
uses: softprops/action-gh-release@master
with:
name: ${{ env.RELEASE_NAME }}
token: ${{ github.token }}
files: ReVanced.zip
body: ${{ steps.read_release.outputs.RELEASE_BODY }}