Split CI into app + sidecar workflows, fix reqwest compilation
Some checks failed
Build Sidecars / Build Sidecar (macOS) (push) Successful in 3m39s
Release / Bump version and tag (push) Has been cancelled
Release / Build App (Linux) (push) Has been cancelled
Release / Build App (Windows) (push) Has been cancelled
Release / Build App (macOS) (push) Has been cancelled
Build Sidecars / Build Sidecar (Windows) (push) Has been cancelled
Build Sidecars / Build Sidecar (Linux) (push) Has been cancelled

CI split:
- release.yml: version bump + lightweight app builds (no Python/sidecar)
- build-sidecar.yml: builds CPU + CUDA sidecar variants per platform,
  uploads as separate release assets, runs in parallel with app builds
- Sidecar workflow uses retry loop to find release (race with version bump)

Fixes:
- Add reqwest "json" feature for .json() method
- Add explicit type annotations for reqwest Response and bytes::Bytes
- Reuse client instance for download (was using reqwest::get directly)

Bundle targets: deb, rpm, nsis, msi, dmg (all formats, app is small now)
Windows upload finds both *.msi and *-setup.exe

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-03-22 07:50:53 -07:00
parent 5947ffef66
commit 9652290a06
5 changed files with 317 additions and 199 deletions

View File

@@ -84,8 +84,8 @@ pub async fn download_sidecar(app: AppHandle, variant: String) -> Result<(), Str
));
}
let release_json: serde_json::Value = release_resp
.json()
let release_json = release_resp
.json::<serde_json::Value>()
.await
.map_err(|e| format!("Failed to parse release JSON: {}", e))?;
@@ -102,7 +102,9 @@ pub async fn download_sidecar(app: AppHandle, variant: String) -> Result<(), Str
.to_string();
// Stream download with progress events
let response = reqwest::get(&download_url)
let response: reqwest::Response = client
.get(&download_url)
.send()
.await
.map_err(|e| format!("Failed to start download: {}", e))?;
@@ -110,7 +112,7 @@ pub async fn download_sidecar(app: AppHandle, variant: String) -> Result<(), Str
return Err(format!("Download failed: HTTP {}", response.status()));
}
let total = response.content_length().unwrap_or(0);
let total: u64 = response.content_length().unwrap_or(0);
let mut downloaded: u64 = 0;
let mut stream = response.bytes_stream();
@@ -119,7 +121,8 @@ pub async fn download_sidecar(app: AppHandle, variant: String) -> Result<(), Str
.map_err(|e| format!("Failed to create zip file: {}", e))?;
while let Some(chunk) = stream.next().await {
let chunk = chunk.map_err(|e| format!("Download stream error: {}", e))?;
let chunk: bytes::Bytes =
chunk.map_err(|e| format!("Download stream error: {}", e))?;
file.write_all(&chunk)
.map_err(|e| format!("Failed to write chunk: {}", e))?;
downloaded += chunk.len() as u64;
@@ -188,8 +191,8 @@ pub async fn check_sidecar_update() -> Result<Option<UpdateInfo>, String> {
));
}
let release_json: serde_json::Value = resp
.json()
let release_json = resp
.json::<serde_json::Value>()
.await
.map_err(|e| format!("Failed to parse release JSON: {}", e))?;