Update Build.yml #126
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
tags: | |
- "*" | |
workflow_dispatch: | |
jobs: | |
patch: | |
runs-on: windows-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@main | |
- name: AngleSharp | |
run: | | |
New-Item -Path ReVanced_Builder -ItemType Directory -Force | |
# https://www.nuget.org/packages/AngleSharp/ | |
$Parameters = @{ | |
Uri = "https://www.nuget.org/api/v2/package/AngleSharp" | |
OutFile = "anglesharp.nupkg" | |
UseBasicParsing = $true | |
Verbose = $true | |
} | |
Invoke-Webrequest @Parameters | |
Add-Type -Assembly System.IO.Compression.FileSystem | |
Add-Type -Assembly System.IO.Compression.FileSystem | |
$ZIP = [IO.Compression.ZipFile]::OpenRead("anglesharp.nupkg") | |
$ZIP.Entries| Where-Object -FilterScript {($_.FullName -eq "lib/net8.0/AngleSharp.xml") -or ($_.FullName -eq "lib/net8.0/AngleSharp.dll")} | ForEach-Object -Process { | |
[IO.Compression.ZipFileExtensions]::ExtractToFile($_, "$($_.Name)", $true) | |
} | |
$ZIP.Dispose() | |
- name: YouTube | |
run: | | |
. Scripts\YouTube.ps1 | |
- name: ReVanced CLI | |
run: | | |
. Scripts\ReVanced_CLI.ps1 | |
- name: Downloading ReVanced Patches | |
run: | | |
. Scripts\ReVanced_Patches.ps1 | |
- name: Vanced MicroG | |
run: | | |
. Scripts\MicroG.ps1 | |
- name: Zulu JDK | |
run: | | |
. Scripts\Zulu_JDK.ps1 | |
- name: Building | |
run: | | |
# https://revanced.app/patches?pkg=com.google.android.youtube | |
# https://github.com/ReVanced/revanced-cli/tree/main/docs | |
& "$env:ProgramFiles\Zulu\zulu*\bin\java.exe" ` | |
-jar "ReVanced_Builder\revanced-cli.jar" ` | |
patch "ReVanced_Builder\youtube.apk" ` | |
--patches "ReVanced_Builder\revanced-patches.rvp" ` | |
--purge ` | |
--out "ReVanced_Builder\revanced.apk" | |
- name: Creating archive | |
run: | | |
$Parameters = @{ | |
Path = "ReVanced_Builder\revanced.apk", "ReVanced_Builder\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 | |
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("YouTubeTag", "${{ env.LatestSupportedYT }}").replace("CLITag", "${{ env.CLIvtag }}").replace("PatchesTag", "${{ env.Patchesvtag }}").replace("IntegrationsTag", "${{ env.IntegrationsTag }}").replace("MicroGTag", "${{ env.MicroGTag }}").replace("ZuluTag", "${{ env.ZuluTag }}") | Set-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Force | |
# https://trstringer.com/github-actions-multiline-strings/ | |
Add-Content -Path $env:GITHUB_OUTPUT -Value "ReleaseBody=ReleaseNotesTemplate.md" | |
$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_path: ${{ steps.read_release.outputs.ReleaseBody }} |