Bundle FFmpeg as Tauri sidecar, download in CI
Some checks failed
Some checks failed
This commit is contained in:
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@ -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 }}
|
||||
|
||||
44
docs/gitea-runner-windows.md
Normal file
44
docs/gitea-runner-windows.md
Normal 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.).
|
||||
1
src-tauri/.gitignore
vendored
1
src-tauri/.gitignore
vendored
@ -2,3 +2,4 @@
|
||||
# will have compiled files and executables
|
||||
/target/
|
||||
/gen/schemas
|
||||
binaries/
|
||||
|
||||
@ -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![
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
@ -35,6 +35,10 @@
|
||||
"icons/128x128@2x.png",
|
||||
"icons/icon.icns",
|
||||
"icons/icon.ico"
|
||||
],
|
||||
"externalBin": [
|
||||
"binaries/ffmpeg",
|
||||
"binaries/ffprobe"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user