Bundle FFmpeg as Tauri sidecar, download in CI
Some checks failed
Release / windows (push) Waiting to run
CI / rust (push) Failing after 1m21s
CI / frontend (push) Successful in 24s
CI / python (push) Failing after 6s
Validate All / validate-all (push) Failing after 4m51s
Release / linux (push) Failing after 5m32s

This commit is contained in:
2026-05-07 11:23:34 -06:00
parent a64ae78833
commit 3093b41033
6 changed files with 98 additions and 1 deletions

View File

@ -28,6 +28,14 @@ jobs:
libgtk-3-dev \
libayatana-appindicator3-dev \
rpm
- name: Download FFmpeg (bundled sidecar)
run: |
mkdir -p src-tauri/binaries
curl -sL "https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz" -o /tmp/ffmpeg.tar.xz
tar -xf /tmp/ffmpeg.tar.xz -C /tmp
cp /tmp/ffmpeg-*-amd64-static/ffmpeg src-tauri/binaries/ffmpeg-x86_64-unknown-linux-gnu
cp /tmp/ffmpeg-*-amd64-static/ffprobe src-tauri/binaries/ffprobe-x86_64-unknown-linux-gnu
chmod +x src-tauri/binaries/*
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -0,0 +1,44 @@
# Gitea Runner — Windows Laptop
Self-hosted runner registered as `windows-laptop` with label `windows-latest`.
## Setup
```powershell
# Download
Invoke-WebRequest -Uri "https://gitea.com/gitea/runner/releases/download/v1.0.1/gitea-runner-1.0.1-windows-amd64.exe" -OutFile "$env:USERPROFILE\gitea-runner-windows-amd64.exe"
# Register (Admin PowerShell)
.\gitea-runner-windows-amd64.exe register --instance http://143.244.157.110:3000 --token NS5LXzLzNOvPKD9Id4SrLQ09bReHOrn6T2c4EyGM --name windows-laptop --labels windows-latest --no-interactive
# Start (foreground)
.\gitea-runner-windows-amd64.exe daemon
# Install as Windows service (auto-starts on boot)
.\gitea-runner-windows-amd64.exe service install
```
## Logs
### Workflow job logs (step output)
Stored on the Gitea server (not locally). Download from:
`http://143.244.157.110:3000/<owner>/<repo>/actions/runs/<run_id>`
Click a job, then the **Download log** button at the top-right.
### Runner daemon logs (runner itself)
| Mode | Log location |
|---|---|
| Foreground (`daemon`) | PowerShell console stdout |
| Windows service (`service install`) | `%ProgramData%\gitea-runner\log\` or Windows Event Viewer → Windows Logs → Application |
## Diagnostics
If a CI job fails, download the full log from the Gitea Actions UI (as above), then search for the first error:
- **Rust**: look for `error[E...]`, `error: could not compile`, or `cargo test` failures
- **Python**: look for `FAILED`, `AssertionError`, or `ModuleNotFoundError`
The runner's own logs (`daemon` mode) will show which job it picked up, container lifecycle, and any infrastructure issues (disk full, Docker unavailable, etc.).

View File

@ -2,3 +2,4 @@
# will have compiled files and executables
/target/
/gen/schemas
binaries/

View File

@ -397,6 +397,15 @@ pub fn run() {
}
}
// Add bundled ffmpeg/ffprobe to PATH so Python subprocesses find them
if let Some(ffmpeg_dir) = paths::bundled_ffmpeg().and_then(|p| p.parent().map(|p| p.to_path_buf())) {
if let Ok(current_path) = std::env::var("PATH") {
let new_path = format!("{}:{}", ffmpeg_dir.display(), current_path);
std::env::set_var("PATH", &new_path);
}
log::info!("Added bundled FFmpeg directory to PATH: {}", ffmpeg_dir.display());
}
Ok(())
})
.invoke_handler(tauri::generate_handler![

View File

@ -62,7 +62,38 @@ pub fn backend_script(name: &str) -> PathBuf {
project_root().join("backend").join(name)
}
/// Absolute path to a script at the project root.
/// Locate bundled ffmpeg binary (sidecar).
pub fn bundled_ffmpeg() -> Option<PathBuf> {
let exe = std::env::current_exe().ok()?;
let dir = exe.parent()?;
// Tauri places externalBin next to the executable
let candidates = [
dir.join("ffmpeg"),
dir.join("binaries").join("ffmpeg"),
];
for c in &candidates {
if c.exists() {
return Some(c.clone());
}
}
None
}
/// Locate bundled ffprobe binary (sidecar).
pub fn bundled_ffprobe() -> Option<PathBuf> {
let exe = std::env::current_exe().ok()?;
let dir = exe.parent()?;
let candidates = [
dir.join("ffprobe"),
dir.join("binaries").join("ffprobe"),
];
for c in &candidates {
if c.exists() {
return Some(c.clone());
}
}
None
}
pub fn root_script(name: &str) -> PathBuf {
project_root().join(name)
}

View File

@ -35,6 +35,10 @@
"icons/128x128@2x.png",
"icons/icon.icns",
"icons/icon.ico"
],
"externalBin": [
"binaries/ffmpeg",
"binaries/ffprobe"
]
}
}