Browse Source

Updated HEVC package downloader

pull/707/head
Dmitry Nefedov 2 months ago
parent
commit
c45b8f626b
  1. 1
      .github/workflows/HEVC.yml
  2. 10
      Scripts/HEVC.ps1
  3. 6
      Scripts/WinGet.ps1

1
.github/workflows/HEVC.yml

@ -25,5 +25,6 @@ jobs:
git config user.email "${{ github.actor }}@users.noreply.github.com" git config user.email "${{ github.actor }}@users.noreply.github.com"
git add HEVC/Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx git add HEVC/Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx
git add HEVC/HEVC_version.txt
git commit -m "Update Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" git commit -m "Update Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
git push git push

10
Scripts/HEVC.ps1

@ -28,11 +28,12 @@ catch [System.Net.WebException]
{ {
Write-Verbose -Message "Connection could not be established with https://store.rg-adguard.net" -Verbose Write-Verbose -Message "Connection could not be established with https://store.rg-adguard.net" -Verbose
exit 1 # Exit with a non-zero status to fail the job exit 1 # Exit with a non-zero status to fail the job
} }
# Get a temp URL # Get a temp URL
$TempURL = $Raw.Links.href | Sort-Object -Property Length -Descending | Select-Object -First 1 # Replace &, unless it fails to be parsed
[xml]$TempURL = ($Raw.Links.outerHTML | Where-Object -FilterScript {$_ -match "appxbundle"}).Replace("&", "&")
if (-not $TempURL) if (-not $TempURL)
{ {
Write-Verbose -Message "https://store.rg-adguard.net does not output correct URL" -Verbose Write-Verbose -Message "https://store.rg-adguard.net does not output correct URL" -Verbose
@ -40,9 +41,12 @@ if (-not $TempURL)
exit 1 # Exit with a non-zero status to fail the job exit 1 # Exit with a non-zero status to fail the job
} }
# Get package build version and save to HEVC\HEVC_version.txt
$TempURL.a."#text".Split("_") | Select-Object -Index 1 | Set-Content -Path HEVC\HEVC_version.txt -Encoding utf8 -Force
# Download archive # Download archive
$Parameters = @{ $Parameters = @{
Uri = $TempURL Uri = $TempURL.a.href
OutFile = "HEVC\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx" OutFile = "HEVC\Microsoft.HEVCVideoExtension_8wekyb3d8bbwe.appx"
Verbose = $true Verbose = $true
UseBasicParsing = $true UseBasicParsing = $true

6
Scripts/WinGet.ps1

@ -10,16 +10,18 @@ $Headers = @{
Authorization = "Bearer $Token" Authorization = "Bearer $Token"
} }
$Parameters = @{ $Parameters = @{
Uri = "https://api.github.com/repos/microsoft/winget-cli/contents/schemas/JSON/manifests" Uri = "https://api.github.com/repos/microsoft/winget-pkgs/contents/doc/manifest/schema"
Headers = $Headers Headers = $Headers
UseBasicParsing = $true UseBasicParsing = $true
Verbose = $true Verbose = $true
} }
$LatestManifest = ((Invoke-RestMethod @Parameters).name | Where-Object {($_ -ne "preview") -and ($_ -ne "latest")}) -replace ("v", "") | Sort-Object -Property {[System.Version]$_} | Select-Object -Last 1 $LatestManifest = (Invoke-RestMethod @Parameters).name | Sort-Object -Property {[System.Version]$_} | Select-Object -Last 1
if ([System.Version]$LocalManifest -lt [System.Version]$LatestManifest) if ([System.Version]$LocalManifest -lt [System.Version]$LatestManifest)
{ {
Write-Warning -Message "A new manifest $($LatestManifest) available. Edit manifests in Scripts\WinGet_Manifests." Write-Warning -Message "A new manifest $($LatestManifest) available. Edit manifests in Scripts\WinGet_Manifests."
exit 1 # Exit with a non-zero status to fail the job
} }
# Get latest version tag for Windows 11 # Get latest version tag for Windows 11

Loading…
Cancel
Save