Fix pruned FFmpeg release inputs
Some checks failed
Core validation / Linux core gate (push) Successful in 56s
Release builds / Linux x64 artifact (push) Successful in 1m23s
Release builds / Windows x64 artifact (push) Successful in 1m15s
Release builds / Publish tagged Gitea release (push) Failing after 19s

This commit is contained in:
gamer147
2026-08-18 09:17:54 -04:00
parent 3a076e2781
commit eeecd1edba
8 changed files with 83 additions and 26 deletions

View File

@@ -10,11 +10,24 @@ if ([string]::IsNullOrWhiteSpace($Destination)) {
$manifest = Get-Content -LiteralPath (Join-Path $PSScriptRoot 'dependency-win64.json') -Raw | ConvertFrom-Json
$downloadDir = Join-Path $repoRoot 'build\downloads'
$archivePath = Join-Path $downloadDir $manifest.archive
$partialArchivePath = "$archivePath.part"
$extractRoot = Join-Path $Destination ([IO.Path]::GetFileNameWithoutExtension($manifest.archive))
New-Item -ItemType Directory -Force -Path $downloadDir | Out-Null
if (-not (Test-Path -LiteralPath $archivePath)) {
Invoke-WebRequest -Uri $manifest.url -OutFile $archivePath
try {
Invoke-WebRequest -Uri $manifest.url -OutFile $partialArchivePath
Move-Item -LiteralPath $partialArchivePath -Destination $archivePath
}
finally {
if (Test-Path -LiteralPath $partialArchivePath) {
Remove-Item -LiteralPath $partialArchivePath -Force
}
}
}
$actualSize = (Get-Item -LiteralPath $archivePath).Length
if ($actualSize -ne $manifest.size) {
throw "FFmpeg archive size mismatch: expected $($manifest.size), got $actualSize"
}
$actualHash = (Get-FileHash -Algorithm SHA256 -LiteralPath $archivePath).Hash.ToLowerInvariant()
if ($actualHash -ne $manifest.sha256) {
@@ -28,7 +41,7 @@ if (-not (Test-Path -LiteralPath (Join-Path $sdkRoot 'include\libavformat\avform
throw "Pinned FFmpeg SDK was not found at $sdkRoot"
}
$reported = & (Join-Path $sdkRoot 'bin\ffmpeg.exe') -version | Select-Object -First 1
$expectedVersion = $manifest.ffmpeg_version -replace '-20260721$', ''
$expectedVersion = $manifest.ffmpeg_version -replace '-\d{8}$', ''
if ($reported -notlike "*$expectedVersion*" ) {
throw "Unexpected FFmpeg build: $reported"
}