mirror of
https://github.com/JDM170/ReVanced_Builder
synced 2025-11-29 14:41:46 +07:00
Add files via upload
This commit is contained in:
136
.github/workflows/Build.yml
vendored
136
.github/workflows/Build.yml
vendored
@@ -20,149 +20,27 @@ jobs:
|
|||||||
|
|
||||||
- name: Downloading YouTube
|
- name: Downloading YouTube
|
||||||
run: |
|
run: |
|
||||||
# Get latest supported YouTube client version via ReVanced JSON
|
. Scripts\YouTube.ps1
|
||||||
# It will let us to download always latest YouTube apk supported by ReVanced team
|
|
||||||
# https://github.com/revanced/revanced-patches/blob/main/patches.json
|
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://raw.githubusercontent.com/revanced/revanced-patches/main/patches.json"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
}
|
|
||||||
$JSON = Invoke-RestMethod @Parameters
|
|
||||||
$versions = ($JSON | Where-Object -FilterScript {$_.compatiblePackages.name -eq "com.google.android.youtube"}).compatiblePackages.versions
|
|
||||||
$LatestSupported = $versions | Sort-Object -Descending -Unique | Select-Object -First 1
|
|
||||||
$LatestSupportedYT = $LatestSupported.replace(".", "-")
|
|
||||||
|
|
||||||
$AngleSharpAssemblyPath = (Get-ChildItem -Path (Split-Path -Path (Get-Package -Name AngleSharp).Source) -Filter "*.dll" -Recurse | Where-Object -FilterScript {$_ -match "standard"} | Select-Object -Last 1).FullName
|
|
||||||
Add-Type -Path $AngleSharpAssemblyPath
|
|
||||||
|
|
||||||
# Get unique key to generate direct link
|
|
||||||
# https://www.apkmirror.com/apk/google-inc/youtube/
|
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/"
|
|
||||||
UseBasicParsing = $false # Disabled
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
$Request = Invoke-Webrequest @Parameters
|
|
||||||
$Parsed = (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).ParseDocument($Request.Content)
|
|
||||||
$Key = $Parsed.All | Where-Object -FilterScript {$_.ClassName -match "accent_bg btn btn-flat downloadButton"} | ForEach-Object -Process {$_.Search}
|
|
||||||
|
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://www.apkmirror.com/apk/google-inc/youtube/youtube-$($LatestSupportedYT)-release/youtube-$($LatestSupportedYT)-2-android-apk-download/download/$($Key)"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
$Request = Invoke-Webrequest @Parameters
|
|
||||||
$Parsed = (New-Object -TypeName AngleSharp.Html.Parser.HtmlParser).ParseDocument($Request.Content)
|
|
||||||
$Key = ($Parsed.All | Where-Object -FilterScript {$_.InnerHtml -eq "here"}).Search
|
|
||||||
|
|
||||||
# Finally, get the real link
|
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://www.apkmirror.com/wp-content/themes/APKMirror/download.php$Key"
|
|
||||||
OutFile = "$PSScriptRoot\youtube.apk"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
Invoke-Webrequest @Parameters
|
|
||||||
|
|
||||||
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8).replace("YouTubeTag", $LatestSupported) | Set-Content -Path Release.md -Encoding utf8 -Force
|
|
||||||
|
|
||||||
- name: Downloading ReVanced CLI
|
- name: Downloading ReVanced CLI
|
||||||
run: |
|
run: |
|
||||||
# https://github.com/revanced/revanced-cli
|
. Scripts\ReVanced_CLI.ps1
|
||||||
$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
|
|
||||||
|
|
||||||
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8).replace("CLITag", $Tag) | Set-Content -Path Release.md -Encoding utf8 -Force
|
|
||||||
|
|
||||||
- name: Downloading ReVanced Patches
|
- name: Downloading ReVanced Patches
|
||||||
run: |
|
run: |
|
||||||
# https://github.com/revanced/revanced-patches
|
. Scripts\ReVanced_Patches.ps1
|
||||||
$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
|
|
||||||
|
|
||||||
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8).replace("PatchesTag", $Tag) | Set-Content -Path Release.md -Encoding utf8 -Force
|
|
||||||
|
|
||||||
- name: Downloading ReVanced Integrations
|
- name: Downloading ReVanced Integrations
|
||||||
run: |
|
run: |
|
||||||
# https://github.com/revanced/revanced-integrations
|
. Scripts\ReVanced_Intergrations.ps1
|
||||||
$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
|
|
||||||
|
|
||||||
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8).replace("IntegrationsTag", $Tag) | Set-Content -Path Release.md -Encoding utf8 -Force
|
|
||||||
|
|
||||||
- name: Downloading Vanced MicroG
|
- name: Downloading Vanced MicroG
|
||||||
run: |
|
run: |
|
||||||
# https://github.com/TeamVanced/VancedMicroG
|
. Scripts\MicroG.ps1
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://api.github.com/repos/TeamVanced/VancedMicroG/releases/latest"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
$Tag = (Invoke-RestMethod @Parameters).tag_name
|
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://github.com/TeamVanced/VancedMicroG/releases/download/$Tag/microg.apk"
|
|
||||||
Outfile = "$PSScriptRoot\microg.apk"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
Invoke-RestMethod @Parameters
|
|
||||||
|
|
||||||
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8).replace("MicroGTag", $Tag) | Set-Content -Path Release.md -Encoding utf8 -Force
|
|
||||||
|
|
||||||
- name: Downloading latest Zulu JDK
|
- name: Downloading latest Zulu JDK
|
||||||
run: |
|
run: |
|
||||||
# https://github.com/ScoopInstaller/Java/blob/master/bucket/zulu-jdk.json
|
. Scripts\Zulu_JDK.ps1
|
||||||
$Parameters = @{
|
|
||||||
Uri = "https://raw.githubusercontent.com/ScoopInstaller/Java/master/bucket/zulu-jdk.json"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
$URL = (Invoke-RestMethod @Parameters).architecture."64bit".url
|
|
||||||
$Tag = (Invoke-RestMethod @Parameters).version
|
|
||||||
$Parameters = @{
|
|
||||||
Uri = $URL
|
|
||||||
Outfile = "$PSScriptRoot\jdk_windows-x64_bin.zip"
|
|
||||||
UseBasicParsing = $true
|
|
||||||
Verbose = $true
|
|
||||||
}
|
|
||||||
Invoke-RestMethod @Parameters
|
|
||||||
|
|
||||||
(Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8).replace("ZuluTag", $Tag) | Set-Content -Path Release.md -Encoding utf8 -Force
|
|
||||||
|
|
||||||
- name: Expanding Zulu JDK
|
- name: Expanding Zulu JDK
|
||||||
run: |
|
run: |
|
||||||
@@ -211,7 +89,7 @@ jobs:
|
|||||||
id: read_release
|
id: read_release
|
||||||
run: |
|
run: |
|
||||||
# https://en.wikipedia.org/wiki/Percent-encoding
|
# https://en.wikipedia.org/wiki/Percent-encoding
|
||||||
$Release = (Get-Content -Path ReleaseNotesTemplate.md -Encoding utf8 -Raw).replace("`n", "%0A").replace("`r", "%0D")
|
$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/
|
# https://trstringer.com/github-actions-multiline-strings/
|
||||||
echo "::set-output name=RELEASE_BODY::$Release"
|
echo "::set-output name=RELEASE_BODY::$Release"
|
||||||
|
|||||||
Reference in New Issue
Block a user