mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-08-31 02:41:44 +00:00
* ci: skip ffmpeg-static CDN download on ubuntu; retry Windows FFmpeg install ubuntu-24.04 runners ship /usr/bin/ffmpeg. Set FFMPEG_BIN so ffmpeg-static's postinstall script skips its GitHub-release binary download, preventing bun install failures when that CDN is unavailable. For Windows: increase BtbN/FFmpeg-Builds download max-attempts 3→8 with longer backoff (30×attempt s) and set FFMPEG_BIN after install so bun install also skips ffmpeg-static's download in both render and test jobs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: fix FFMPEG_BIN approach — use writable copy via composite action /usr/bin/ffmpeg is not writable by the runner user. When bun runs ffmpeg-static's postinstall script in a context where process.exit(0) is intercepted, the skip-if-exists check has no effect and the download proceeds to the destination path. Pointing FFMPEG_BIN at a system path (/usr/bin/ffmpeg) therefore causes EACCES even when the CDN returns 200. Replace the top-level env var with a prepare-ffmpeg-bin composite action that copies the system ffmpeg to $RUNNER_TEMP (writable). Call it before every bun install step in the CI workflow. Whether the postinstall script skips or overwrites, the write target is now writable and the job succeeds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * ci: skip apt fallback in prepare-ffmpeg-bin; use stub when ffmpeg absent ubuntu-24.04 GHA runners do not have ffmpeg pre-installed. The apt-get fallback triggered the install of ffmpeg and its dependencies, but the Azure apt mirror returned 404 for libcaca0, aborting the composite action. ffmpeg-static's postinstall only needs a regular file to exist at FFMPEG_BIN in order to reach the statSync check and call process.exit(0) — it does not need a real executable. Write a minimal shell stub when 'which ffmpeg' returns empty. Jobs that require an actual ffmpeg binary (cli-smoke-required) install it via apt before calling this action, so 'which ffmpeg' returns the real path and the copy branch runs instead. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
61 lines
2.4 KiB
YAML
61 lines
2.4 KiB
YAML
name: Install FFmpeg (Windows)
|
|
description: >-
|
|
Download a pinned FFmpeg GPL build for Windows from BtbN/FFmpeg-Builds and put
|
|
ffmpeg.exe / ffprobe.exe on PATH. We bypass `choco install ffmpeg` because
|
|
the Chocolatey community feed regularly returns 503 / 504 / NuGet resolver
|
|
errors with no retry, which makes it unsuitable as a CI dependency. From the
|
|
consumer's perspective this is equivalent — `where ffmpeg` (the PR #336
|
|
validation) and `findFFmpeg()` both pass.
|
|
|
|
inputs:
|
|
release-url:
|
|
description: >-
|
|
URL of a BtbN/FFmpeg-Builds zip to install. Pinned to a specific
|
|
autobuild tag so a new upstream nightly can't silently change encoder
|
|
behavior under us. The asset filename embeds the git hash, so both
|
|
the tag and the filename must be bumped together when upgrading.
|
|
required: false
|
|
default: https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2026-04-30-13-44/ffmpeg-N-124278-gcc3ca17127-win64-gpl.zip
|
|
max-attempts:
|
|
description: Max download attempts before failing.
|
|
required: false
|
|
default: "8"
|
|
|
|
runs:
|
|
using: composite
|
|
steps:
|
|
- name: Install FFmpeg from BtbN/FFmpeg-Builds
|
|
shell: pwsh
|
|
run: |
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$url = '${{ inputs.release-url }}'
|
|
$maxAttempts = [int]'${{ inputs.max-attempts }}'
|
|
|
|
$zip = Join-Path $env:RUNNER_TEMP 'ffmpeg.zip'
|
|
$dir = Join-Path $env:RUNNER_TEMP 'ffmpeg'
|
|
New-Item -ItemType Directory -Force -Path $dir | Out-Null
|
|
|
|
for ($attempt = 1; $attempt -le $maxAttempts; $attempt++) {
|
|
Write-Host "--- Downloading ffmpeg from BtbN/FFmpeg-Builds (attempt $attempt/$maxAttempts) ---"
|
|
try {
|
|
Invoke-WebRequest -Uri $url -OutFile $zip -UseBasicParsing
|
|
break
|
|
} catch {
|
|
Write-Warning "Download failed: $($_.Exception.Message)"
|
|
if ($attempt -eq $maxAttempts) { throw }
|
|
Start-Sleep -Seconds (30 * $attempt)
|
|
}
|
|
}
|
|
|
|
Write-Host "--- Extracting ffmpeg ---"
|
|
Expand-Archive -Path $zip -DestinationPath $dir -Force
|
|
|
|
$bin = Get-ChildItem -Path $dir -Recurse -Filter 'ffmpeg.exe' | Select-Object -First 1
|
|
if (-not $bin) { throw "ffmpeg.exe not found after extracting $url" }
|
|
|
|
Add-Content -Path $env:GITHUB_PATH -Value $bin.Directory.FullName
|
|
|
|
Write-Host "--- ffmpeg sanity check ---"
|
|
& $bin.FullName -version | Select-Object -First 1
|