Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Add FFmpeg DLLs to PATH and copy to release

Richie McIlroyc2fbe528c3e1
diff --git a/.github/workflows/performance-regressions.yml b/.github/workflows/performance-regressions.yml
index 9ff98494f..8a8e1b7d9 100644
--- a/.github/workflows/performance-regressions.yml
+++ b/.github/workflows/performance-regressions.yml
@@ -40,6 +40,11 @@ jobs:
- name: Native dependencies
run: node scripts/setup.js
+ - name: Add FFmpeg DLLs to PATH
+ if: runner.os == 'Windows'
+ shell: pwsh
+ run: Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}\\target\\ffmpeg\\bin"
+
- name: Run performance suite
run: cargo run --release -p cap-test -- suite performance --recording-path performance-fixtures/reference-recording.cap --duration 8 --output performance-results.json --gate
diff --git a/scripts/setup.js b/scripts/setup.js
index be1b5ed6e..d2ea56976 100644
--- a/scripts/setup.js
+++ b/scripts/setup.js
@@ -119,15 +119,16 @@ async function main() {
console.log("Extracted ffmpeg");
} else console.log("Using cached ffmpeg");
- // alternative to adding ffmpeg/bin to PATH
- await fs.mkdir(path.join(targetDir, "debug"), { recursive: true });
- for (const name of await fs.readdir(path.join(ffmpegDir, "bin"))) {
- await fs.copyFile(
- path.join(ffmpegDir, "bin", name),
- path.join(targetDir, "debug", name),
- );
+ for (const profile of ["debug", "release"]) {
+ await fs.mkdir(path.join(targetDir, profile), { recursive: true });
+ for (const name of await fs.readdir(path.join(ffmpegDir, "bin"))) {
+ await fs.copyFile(
+ path.join(ffmpegDir, "bin", name),
+ path.join(targetDir, profile, name),
+ );
+ }
}
- console.log("Copied ffmpeg dylibs to target/debug");
+ console.log("Copied ffmpeg DLLs to target/debug and target/release");
if (!(await fileExists(path.join(targetDir, "native-deps"))))
await fs.mkdir(path.join(targetDir, "native-deps"), { recursive: true });