77 - " v*"
88 pull_request :
99 branches : [main]
10+ # PRs only re-bundle when something that affects the output changed.
11+ # Doc / workflow / other changes get a free pass.
12+ paths :
13+ - " **/Cargo.toml"
14+ - " Cargo.lock"
15+ - " cli/**"
16+ - " lib/**"
17+ - " ui/**"
18+ - " .github/workflows/bundle.yml"
1019 workflow_dispatch :
1120
1221jobs :
1524 strategy :
1625 fail-fast : false
1726 matrix :
18- os : [macos-latest, ubuntu-latest, windows-latest]
27+ # PRs run linux only as a smoke check; main/tag/manual runs cover all three OSes.
28+ # windows-2022 (not windows-latest): windows-latest aliases to VS18 preview,
29+ # whose MSVC 14.50 headers + cmake-rs can't resolve a Visual Studio generator
30+ # for aws-lc-sys, breaking `dx bundle`. Revisit once the ecosystem catches up.
31+ os : ${{ fromJSON(github.event_name == 'pull_request' && '["ubuntu-latest"]' || '["macos-latest","ubuntu-latest","windows-2022"]') }}
1932
2033 env :
2134 BUILD_N0DES_API_SECRET : ${{ secrets.N0DES_API_SECRET }}
2841
2942 - uses : dtolnay/rust-toolchain@stable
3043
31- - uses : cargo-bins/cargo-binstall@main
32-
44+ # Use a stable shared-key per OS instead of the default Cargo.toml/Cargo.lock hash.
45+ # `cargo generate-lockfile` and the in-place version bump otherwise rotate the
46+ # default cache key on every run, throwing away dep compile artefacts.
47+ # Only save the cache from main / tag / manual runs so PRs don't pollute it.
3348 - uses : Swatinem/rust-cache@v2
49+ with :
50+ shared-key : bundle-${{ matrix.os }}
51+ save-if : ${{ github.event_name != 'pull_request' }}
3452
3553 - name : Install system dependencies (Linux)
3654 if : runner.os == 'Linux'
@@ -45,15 +63,43 @@ jobs:
4563 libfuse2 \
4664 libxdo-dev
4765
48- - name : Install Dioxus CLI
49- # Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
50- # held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
51- # and the upstream fix is still open:
52- # https://github.com/DioxusLabs/dioxus/issues/5233
53- # Bump in lockstep with the lib once that issue is resolved.
54- run : cargo binstall dioxus-cli@0.7.2 --disable-telemetry --locked --force -y
55- env :
56- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
66+ # Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
67+ # held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
68+ # and the upstream fix is still open:
69+ # https://github.com/DioxusLabs/dioxus/issues/5233
70+ # Bump in lockstep with the lib once that issue is resolved.
71+ #
72+ # Download the prebuilt `dx` binary from GitHub releases rather than
73+ # `cargo install dioxus-cli`, which compiles the whole CLI from source
74+ # (5–10 min per matrix leg, every run).
75+ - name : Install Dioxus CLI (Unix)
76+ if : runner.os != 'Windows'
77+ shell : bash
78+ run : |
79+ set -euo pipefail
80+ DX_VER=0.7.2
81+ TRIPLE=$(rustc -Vv | awk '/^host:/{print $2}')
82+ URL="https://github.com/DioxusLabs/dioxus/releases/download/v${DX_VER}/dx-${TRIPLE}.tar.gz"
83+ echo "Downloading $URL"
84+ mkdir -p "$HOME/.cargo/bin"
85+ curl -fsSL "$URL" | tar -xz -C "$HOME/.cargo/bin"
86+ chmod +x "$HOME/.cargo/bin/dx"
87+ "$HOME/.cargo/bin/dx" --version
88+
89+ - name : Install Dioxus CLI (Windows)
90+ if : runner.os == 'Windows'
91+ shell : pwsh
92+ run : |
93+ $DX_VER = '0.7.2'
94+ $TRIPLE = ((rustc -Vv | Select-String '^host: ').ToString() -replace '^host: ','').Trim()
95+ $URL = "https://github.com/DioxusLabs/dioxus/releases/download/v$DX_VER/dx-$TRIPLE.zip"
96+ Write-Host "Downloading $URL"
97+ $tmp = Join-Path $env:RUNNER_TEMP 'dx.zip'
98+ Invoke-WebRequest -Uri $URL -OutFile $tmp -UseBasicParsing
99+ $dst = Join-Path $env:USERPROFILE '.cargo\bin'
100+ New-Item -ItemType Directory -Force -Path $dst | Out-Null
101+ Expand-Archive -Path $tmp -DestinationPath $dst -Force
102+ & (Join-Path $dst 'dx.exe') --version
57103
58104 - uses : actions/setup-node@v4
59105 if : runner.os == 'macOS'
@@ -167,8 +213,15 @@ jobs:
167213 APPLE_SIGNING_IDENTITY : ${{ secrets.APPLE_SIGNING_IDENTITY }}
168214 run : |
169215 mkdir -p ui/dist
170- if [ ! -d ui/dist/Datum.app ] && [ -d ui/target/dx/Datum/release/macos/Datum.app ]; then
171- cp -R ui/target/dx/Datum/release/macos/Datum.app ui/dist/
216+ if [ ! -d ui/dist/Datum.app ]; then
217+ if [ -d ui/target/dx/Datum/release/macos/Datum.app ]; then
218+ cp -R ui/target/dx/Datum/release/macos/Datum.app ui/dist/
219+ else
220+ APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
221+ if [ -n "$APP" ]; then
222+ cp -R "$APP" ui/dist/Datum.app
223+ fi
224+ fi
172225 fi
173226 test -d ui/dist/Datum.app
174227 ./ui/packaging/dmg/mk-dmg-icns-from-linux-png.sh
@@ -197,11 +250,22 @@ jobs:
197250 # sentry-cli has nothing to symbolicate against on macOS, so we run
198251 # dsymutil manually and stage the result outside the .app bundle so
199252 # it doesn't get packaged into the DMG.
200- BIN="ui/target/dx/Datum/release/macos/Datum.app/Contents/MacOS/Datum"
253+ APP="ui/dist/Datum.app"
254+ if [ ! -d "$APP" ]; then
255+ APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
256+ fi
257+ if [ -z "$APP" ] || [ ! -d "$APP" ]; then
258+ echo "macOS .app not found (expected ui/dist/Datum.app after DMG step)" >&2
259+ find ui/target/dx -type d -name '*.app' 2>/dev/null | head -20 >&2 || true
260+ exit 1
261+ fi
262+ EXEC=$(/usr/libexec/PlistBuddy -c 'Print :CFBundleExecutable' "$APP/Contents/Info.plist")
263+ BIN="$APP/Contents/MacOS/$EXEC"
201264 DSYM_DIR="$RUNNER_TEMP/dsyms"
202265 mkdir -p "$DSYM_DIR"
203266 if [ ! -f "$BIN" ]; then
204- echo "Bundled binary not found at $BIN" >&2
267+ echo "Bundled binary not found at $BIN (app: $APP)" >&2
268+ ls -la "$APP/Contents/MacOS" >&2 || true
205269 exit 1
206270 fi
207271 dsymutil "$BIN" -o "$DSYM_DIR/Datum.dSYM"
@@ -221,9 +285,18 @@ jobs:
221285 mkdir -p "$INSTALL_DIR"
222286 export PATH="$INSTALL_DIR:$PATH"
223287 curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.2.3 sh
288+ MACOS_BIN_DIR="ui/dist/Datum.app/Contents/MacOS"
289+ if [ ! -d "$MACOS_BIN_DIR" ]; then
290+ APP=$(find ui/target/dx -path '*/release/macos/*.app' -type d 2>/dev/null | head -1)
291+ MACOS_BIN_DIR="${APP}/Contents/MacOS"
292+ fi
293+ if [ ! -d "$MACOS_BIN_DIR" ]; then
294+ echo "Sentry: macOS Contents/MacOS not found under ui/dist or ui/target/dx" >&2
295+ exit 1
296+ fi
224297 sentry-cli debug-files upload --include-sources \
225298 "$RUNNER_TEMP/dsyms" \
226- ui/target/dx/Datum/release/macos/Datum.app/Contents/MacOS/
299+ "$MACOS_BIN_DIR"
227300 else
228301 echo "SENTRY_AUTH_TOKEN not set, skipping debug symbol upload"
229302 fi
0 commit comments