Skip to content

Commit 5c2f46e

Browse files
wpfleger96npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7
andauthored
fix(desktop): make Windows release compile cleanly (#1029)
Signed-off-by: Will Pfleger <pfleger.will@gmail.com> Co-authored-by: npub1mn7jgtj4w2pd0g0zeuhxsa6jy6p0rewxz4kujt98my82ahfmp72sxjexk7 <dcfd242e557282d7a1e2cf2e6877522682f1e5c6156dc92ca7d90eaedd3b0f95@sprout-oss.stage.blox.sqprod.co>
1 parent 6caa359 commit 5c2f46e

5 files changed

Lines changed: 102 additions & 54 deletions

File tree

.github/workflows/release.yml

Lines changed: 81 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ on:
1515
required: true
1616

1717
jobs:
18-
release:
19-
name: Release
18+
# Shared setup: determine the version and create the release objects all four
19+
# platform jobs upload into. Runs on ubuntu with no OIDC so a branch
20+
# workflow_dispatch can exercise the platform builds without the codesign
21+
# AssumeRole wall that gates the arm64 job.
22+
setup:
23+
name: Setup
2024
if: github.repository == 'block/buzz'
21-
runs-on: macos-latest
22-
timeout-minutes: 60
25+
runs-on: ubuntu-latest
26+
timeout-minutes: 10
2327
permissions:
2428
contents: write
25-
id-token: write # required by block/apple-codesign-action for OIDC
2629
outputs:
2730
version: ${{ steps.version.outputs.version }}
28-
archive_name: ${{ steps.artifacts.outputs.archive_name }}
29-
sig: ${{ steps.read-sig.outputs.sig }}
3031
steps:
3132
- name: Determine version
3233
id: version
@@ -50,6 +51,61 @@ jobs:
5051
exit 1
5152
fi
5253
54+
# Checkout at the same ref the platform jobs use so git rev-parse HEAD
55+
# pins the release to the right commit via --target.
56+
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
57+
with:
58+
ref: ${{ github.event_name == 'push' && github.ref || inputs.ref }}
59+
persist-credentials: false
60+
61+
- name: Create versioned GitHub release
62+
env:
63+
VERSION: ${{ steps.version.outputs.version }}
64+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
run: |
66+
RELEASE_SHA=$(git rev-parse HEAD)
67+
NOTES=""
68+
if [[ -f CHANGELOG.md ]]; then
69+
NOTES=$(awk "/^## v${VERSION}$/,/^## v/" CHANGELOG.md | sed '$d')
70+
fi
71+
if [[ -z "$NOTES" ]]; then
72+
NOTES="Buzz Desktop v${VERSION}"
73+
fi
74+
PRERELEASE_FLAGS=()
75+
if [[ "$VERSION" =~ -(test|alpha|beta|rc)([.-]|$) ]]; then
76+
PRERELEASE_FLAGS=(--prerelease --latest=false)
77+
fi
78+
gh release create "v${VERSION}" \
79+
--target "$RELEASE_SHA" \
80+
--title "Buzz Desktop v${VERSION}" \
81+
--notes "$NOTES" \
82+
"${PRERELEASE_FLAGS[@]}"
83+
84+
- name: Create rolling auto-update release
85+
env:
86+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87+
run: |
88+
gh release create buzz-desktop-latest \
89+
--prerelease \
90+
--title "Buzz Desktop Auto-Update" \
91+
--notes "Rolling release for the Tauri auto-updater. Do not download manually — use the versioned release instead." \
92+
2>/dev/null || true
93+
94+
release:
95+
name: Release
96+
if: github.repository == 'block/buzz'
97+
runs-on: macos-latest
98+
needs: setup
99+
timeout-minutes: 60
100+
permissions:
101+
contents: write
102+
id-token: write # required by block/apple-codesign-action for OIDC
103+
outputs:
104+
archive_name: ${{ steps.artifacts.outputs.archive_name }}
105+
sig: ${{ steps.read-sig.outputs.sig }}
106+
env:
107+
VERSION: ${{ needs.setup.outputs.version }}
108+
steps:
53109
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
54110
with:
55111
ref: ${{ github.event_name == 'push' && github.ref || inputs.ref }}
@@ -61,8 +117,6 @@ jobs:
61117
run: just desktop-install-ci
62118

63119
- name: Patch version
64-
env:
65-
VERSION: ${{ steps.version.outputs.version }}
66120
run: |
67121
cd desktop && node scripts/set-version-from-tag.mjs "$VERSION"
68122
cd src-tauri && cargo update --workspace
@@ -218,38 +272,15 @@ jobs:
218272
env:
219273
SIG_PATH: ${{ steps.artifacts.outputs.sig }}
220274

221-
- name: Create versioned GitHub release
275+
- name: Upload arm64 DMG to versioned GitHub release
222276
env:
223-
VERSION: ${{ steps.version.outputs.version }}
224277
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
225278
DMG_PATH: ${{ steps.artifacts.outputs.dmg }}
226-
run: |
227-
RELEASE_SHA=$(git rev-parse HEAD)
228-
NOTES=""
229-
if [[ -f CHANGELOG.md ]]; then
230-
NOTES=$(awk "/^## v${VERSION}$/,/^## v/" CHANGELOG.md | sed '$d')
231-
fi
232-
if [[ -z "$NOTES" ]]; then
233-
NOTES="Buzz Desktop v${VERSION}"
234-
fi
235-
PRERELEASE_FLAGS=()
236-
if [[ "$VERSION" =~ -(test|alpha|beta|rc)([.-]|$) ]]; then
237-
PRERELEASE_FLAGS=(--prerelease --latest=false)
238-
fi
239-
gh release create "v${VERSION}" \
240-
--target "$RELEASE_SHA" \
241-
--title "Buzz Desktop v${VERSION}" \
242-
--notes "$NOTES" \
243-
"${PRERELEASE_FLAGS[@]}" \
244-
"$DMG_PATH"
279+
run: gh release upload "v${VERSION}" "$DMG_PATH" --clobber
245280

246281
- name: Upload updater archive to rolling release
282+
if: github.event_name == 'push'
247283
run: |
248-
gh release create buzz-desktop-latest \
249-
--prerelease \
250-
--title "Buzz Desktop Auto-Update" \
251-
--notes "Rolling release for the Tauri auto-updater. Do not download manually — use the versioned release instead." \
252-
2>/dev/null || true
253284
gh release upload buzz-desktop-latest \
254285
"$ARCHIVE_PATH" \
255286
"$SIG_PATH" \
@@ -263,7 +294,7 @@ jobs:
263294
name: Release macOS (Intel)
264295
if: github.repository == 'block/buzz'
265296
runs-on: macos-latest
266-
needs: release
297+
needs: setup
267298
timeout-minutes: 60
268299
permissions:
269300
contents: write
@@ -272,7 +303,7 @@ jobs:
272303
archive_name: ${{ steps.artifacts.outputs.archive_name }}
273304
sig: ${{ steps.read-sig.outputs.sig }}
274305
env:
275-
VERSION: ${{ needs.release.outputs.version }}
306+
VERSION: ${{ needs.setup.outputs.version }}
276307
TARGET: x86_64-apple-darwin
277308
steps:
278309
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
@@ -397,6 +428,7 @@ jobs:
397428
DMG_PATH: ${{ steps.unsigned.outputs.dmg }}
398429

399430
- name: Upload updater archive to rolling release
431+
if: github.event_name == 'push'
400432
run: |
401433
gh release upload buzz-desktop-latest \
402434
"$ARCHIVE_PATH" \
@@ -411,7 +443,7 @@ jobs:
411443
name: Release Linux
412444
if: github.repository == 'block/buzz'
413445
runs-on: ubuntu-latest
414-
needs: release
446+
needs: setup
415447
timeout-minutes: 60
416448
permissions:
417449
contents: write
@@ -462,7 +494,7 @@ jobs:
462494

463495
- name: Patch version
464496
env:
465-
VERSION: ${{ needs.release.outputs.version }}
497+
VERSION: ${{ needs.setup.outputs.version }}
466498
run: |
467499
cd desktop && node scripts/set-version-from-tag.mjs "$VERSION"
468500
cd src-tauri && cargo update --workspace
@@ -531,7 +563,7 @@ jobs:
531563
# NOTE: .deb is NOT auto-updatable (Tauri updater constraint — only AppImage supports it on Linux)
532564
- name: Upload Linux artifacts to versioned GitHub release
533565
env:
534-
VERSION: ${{ needs.release.outputs.version }}
566+
VERSION: ${{ needs.setup.outputs.version }}
535567
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
536568
DEB_PATH: ${{ steps.linux-artifacts.outputs.deb }}
537569
APPIMAGE_PATH: ${{ steps.linux-artifacts.outputs.appimage }}
@@ -542,6 +574,7 @@ jobs:
542574
--clobber
543575
544576
- name: Upload updater archive to rolling release
577+
if: github.event_name == 'push'
545578
run: |
546579
gh release upload buzz-desktop-latest \
547580
"$ARCHIVE_PATH" \
@@ -555,15 +588,15 @@ jobs:
555588
release-windows:
556589
name: Release Windows
557590
runs-on: windows-latest
558-
needs: release
591+
needs: setup
559592
timeout-minutes: 60
560593
permissions:
561594
contents: write
562595
outputs:
563596
archive_name: ${{ steps.artifacts.outputs.archive_name }}
564597
sig: ${{ steps.read-sig.outputs.sig }}
565598
env:
566-
VERSION: ${{ needs.release.outputs.version }}
599+
VERSION: ${{ needs.setup.outputs.version }}
567600
TARGET: x86_64-pc-windows-msvc
568601
steps:
569602
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
@@ -664,6 +697,7 @@ jobs:
664697
EXE_PATH: ${{ steps.artifacts.outputs.exe }}
665698

666699
- name: Upload updater archive to rolling release
700+
if: github.event_name == 'push'
667701
shell: bash
668702
run: |
669703
gh release upload buzz-desktop-latest \
@@ -677,13 +711,16 @@ jobs:
677711

678712
assemble-manifest:
679713
name: Assemble multi-platform latest.json
714+
# Only a real tag push assembles latest.json — a branch workflow_dispatch
715+
# skips the rolling-release uploads, so its archive URLs never exist.
716+
if: github.event_name == 'push'
680717
runs-on: ubuntu-latest
681-
needs: [release, release-macos-x64, release-linux, release-windows]
718+
needs: [setup, release, release-macos-x64, release-linux, release-windows]
682719
timeout-minutes: 10
683720
permissions:
684721
contents: write
685722
env:
686-
VERSION: ${{ needs.release.outputs.version }}
723+
VERSION: ${{ needs.setup.outputs.version }}
687724
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
688725
steps:
689726
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
@@ -745,9 +782,4 @@ jobs:
745782
746783
- name: Upload latest.json to rolling release
747784
run: |
748-
gh release create buzz-desktop-latest \
749-
--prerelease \
750-
--title "Buzz Desktop Auto-Update" \
751-
--notes "Rolling release for the Tauri auto-updater. Do not download manually — use the versioned release instead." \
752-
2>/dev/null || true
753785
gh release upload buzz-desktop-latest latest.json --clobber

desktop/src-tauri/Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ png = "0.18"
7979
zip = "8"
8080
sherpa-onnx = "1.12"
8181
regex = "1"
82-
rusqlite = "0.37"
82+
rusqlite = { version = "0.37", features = ["bundled"] }
8383
axum = "0.8"
8484
rodio = "0.22"
8585
earshot = "1.0"

desktop/src-tauri/src/commands/media.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ fn fd_real_path(file: &std::fs::File) -> Result<std::path::PathBuf, String> {
8383
use windows_sys::Win32::Storage::FileSystem::{
8484
GetFinalPathNameByHandleW, FILE_NAME_NORMALIZED,
8585
};
86-
let handle = file.as_raw_handle() as isize;
86+
let handle = file.as_raw_handle() as *mut core::ffi::c_void;
8787
let mut buf = vec![0u16; 1024];
8888
let len = unsafe {
8989
GetFinalPathNameByHandleW(

desktop/src-tauri/src/migration.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ const SHARED_AGENT_FILES: &[&str] = &[
3636
/// dev data directory. Each entry becomes a single directory symlink.
3737
const SHARED_AGENT_DIRS: &[&str] = &["agents/teams"];
3838

39+
/// Create a symlink at `dst` pointing to `src`.
40+
///
41+
/// Worktree sync is a dev-only feature (`BUZZ_SHARE_IDENTITY=1`); on Windows
42+
/// this is a no-op so the rest of `sync_shared_agent_data` keeps compiling and
43+
/// running harmlessly.
44+
#[cfg(unix)]
45+
fn symlink(src: &Path, dst: &Path) -> std::io::Result<()> {
46+
std::os::unix::fs::symlink(src, dst)
47+
}
48+
49+
#[cfg(not(unix))]
50+
fn symlink(_src: &Path, _dst: &Path) -> std::io::Result<()> {
51+
Ok(())
52+
}
53+
3954
fn canonical_dev_data_dir(current: &Path) -> Option<PathBuf> {
4055
current.parent().map(|p| p.join(CANONICAL_DEV_IDENTIFIER))
4156
}
@@ -244,7 +259,7 @@ pub fn sync_shared_agent_data(app: &tauri::AppHandle) {
244259
let _ = std::fs::remove_file(&dst);
245260
}
246261

247-
match std::os::unix::fs::symlink(&src, &dst) {
262+
match symlink(&src, &dst) {
248263
Ok(_) => synced += 1,
249264
Err(e) => {
250265
eprintln!("buzz-desktop: shared-agent-sync: failed to symlink {rel}: {e}");
@@ -284,7 +299,7 @@ pub fn sync_shared_agent_data(app: &tauri::AppHandle) {
284299
}
285300
// Replace the sibling's dir with a symlink to canonical.
286301
let _ = std::fs::remove_dir_all(&sibling_dir);
287-
let _ = std::os::unix::fs::symlink(&canonical_target, &sibling_dir);
302+
let _ = symlink(&canonical_target, &sibling_dir);
288303
eprintln!(
289304
"buzz-desktop: shared-agent-sync: migrated {rel} from {}",
290305
sibling.display()
@@ -329,7 +344,7 @@ pub fn sync_shared_agent_data(app: &tauri::AppHandle) {
329344
let _ = std::fs::remove_dir_all(&dst);
330345
}
331346

332-
match std::os::unix::fs::symlink(&src, &dst) {
347+
match symlink(&src, &dst) {
333348
Ok(_) => synced += 1,
334349
Err(e) => {
335350
eprintln!("buzz-desktop: shared-agent-sync: failed to symlink {rel}: {e}");

0 commit comments

Comments
 (0)