Skip to content

Commit 94c43a9

Browse files
jonberenguerclaude
andcommitted
Fix CI FFmpeg setup: scope per-OS + Windows zip extract fallback
The build steps ran download-ffmpeg.js with no arg (default 'both'), so each runner fetched and extracted *both* platform binaries — coupling each job to the other OS's extractor. The Windows job then failed because the win .zip is extracted with unzip, which isn't on the windows-latest runner. Scope each job to its own platform (linux/win), and make the win extraction fall back from unzip to bsdtar (tar -xf, present on windows-latest) so the Windows runner can unpack the zip. Linux/cross-compile dev still use unzip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 55dc52d commit 94c43a9

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: npm ci
2323

2424
- name: Set up FFmpeg binary
25-
run: node scripts/download-ffmpeg.js
25+
run: node scripts/download-ffmpeg.js linux
2626

2727
- name: Build Linux AppImage
2828
run: npm run build:linux
@@ -49,7 +49,7 @@ jobs:
4949
run: npm ci
5050

5151
- name: Set up FFmpeg binary
52-
run: node scripts/download-ffmpeg.js
52+
run: node scripts/download-ffmpeg.js win
5353

5454
- name: Build Windows portable
5555
run: npm run build:win

scripts/download-ffmpeg.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,13 @@ const SOURCES = {
5959
destDir: path.join(__dirname, '..', 'bin', 'win'),
6060
destName: 'ffmpeg.exe',
6161
executable: false,
62-
extract: (archivePath, outDir) => execSync(`unzip -o -q "${archivePath}" -d "${outDir}"`, { stdio: 'inherit' }),
63-
needs: '`unzip` (apt-get install -y unzip)',
62+
// `unzip` on Linux (cross-compile dev / ubuntu CI); fall back to bsdtar's
63+
// zip support on the windows-latest runner, which has `tar` but not `unzip`.
64+
extract: (archivePath, outDir) => {
65+
try { execSync(`unzip -o -q "${archivePath}" -d "${outDir}"`, { stdio: 'inherit' }) }
66+
catch { execSync(`tar -xf "${archivePath}" -C "${outDir}"`, { stdio: 'inherit' }) }
67+
},
68+
needs: '`unzip` (apt-get install -y unzip) or `tar` (bsdtar, default on Windows)',
6469
},
6570
}
6671

0 commit comments

Comments
 (0)