Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/build-baseline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,9 @@ jobs:
- name: Build frontend
run: npm run build --workspace @bandscope/desktop
- name: Build native shell
run: npm exec --workspace @bandscope/desktop -- tauri build --target "$BANDSCOPE_TARGET_TRIPLE" --bundles dmg
env:
BANDSCOPE_TAURI_BUILD_ATTEMPTS: "2"
run: scripts/release/build_tauri_bundle_with_retry.sh @bandscope/desktop "$BANDSCOPE_TARGET_TRIPLE" dmg
- name: Package macOS amd64 artifact
run: python3 scripts/release/package_desktop_artifact.py
- name: Upload macOS amd64 artifact
Expand Down Expand Up @@ -271,7 +273,9 @@ jobs:
- name: Build frontend
run: npm run build --workspace @bandscope/desktop
- name: Build native shell
run: npm exec --workspace @bandscope/desktop -- tauri build --target "$BANDSCOPE_TARGET_TRIPLE" --bundles dmg
env:
BANDSCOPE_TAURI_BUILD_ATTEMPTS: "2"
run: scripts/release/build_tauri_bundle_with_retry.sh @bandscope/desktop "$BANDSCOPE_TARGET_TRIPLE" dmg
- name: Package macOS arm64 artifact
run: python3 scripts/release/package_desktop_artifact.py
- name: Upload macOS arm64 artifact
Expand Down
46 changes: 46 additions & 0 deletions scripts/release/build_tauri_bundle_with_retry.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
set -euo pipefail

if [ "$#" -ne 3 ]; then
echo "usage: $0 <npm-workspace> <target-triple> <bundles>" >&2
exit 2
fi

workspace="$1"
target_triple="$2"
bundles="$3"
attempts="${BANDSCOPE_TAURI_BUILD_ATTEMPTS:-1}"

if ! [[ "$attempts" =~ ^[1-9][0-9]*$ ]]; then
echo "BANDSCOPE_TAURI_BUILD_ATTEMPTS must be a positive integer" >&2
exit 2
fi

cleanup_macos_dmg_state() {
local dmg_dir="apps/desktop/src-tauri/target/${target_triple}/release/bundle/dmg"
rm -rf "$dmg_dir"
Comment on lines +19 to +21

if command -v hdiutil >/dev/null 2>&1; then
hdiutil info || true
hdiutil detach "/Volumes/BandScope" -force || true
hdiutil detach "/Volumes/BandScope 0.1.3" -force || true
fi
Comment on lines +23 to +27
}

for ((attempt = 1; attempt <= attempts; attempt++)); do
echo "Tauri bundle build attempt ${attempt}/${attempts} for ${target_triple} (${bundles})"
if npm exec --workspace "$workspace" -- tauri build --target "$target_triple" --bundles "$bundles"; then
exit 0
fi

status="$?"
if [ "$attempt" -eq "$attempts" ]; then
exit "$status"
Comment on lines +32 to +38
fi

echo "::warning::Tauri bundle build failed with exit ${status}; cleaning partial DMG state before retry."
if [[ "$bundles" == *dmg* ]]; then
cleanup_macos_dmg_state
fi
sleep 10
done
Loading