Skip to content

Commit 9562219

Browse files
Merge pull request #155 from datum-cloud/chore/sentry-release-reporting-and-dioxus-0.7.9
chore: enable Sentry release reporting and bump Dioxus to 0.7.9
2 parents ad2485f + abe4463 commit 9562219

9 files changed

Lines changed: 279 additions & 139 deletions

File tree

.github/workflows/bundle.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ jobs:
4646
libxdo-dev
4747
4848
- name: Install Dioxus CLI
49-
# Should be pinned to same version as dioxus in Cargo.toml
50-
# note: dx bundle on Windows fails with 0.7.3, see
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:
5152
# https://github.com/DioxusLabs/dioxus/issues/5233
53+
# Bump in lockstep with the lib once that issue is resolved.
5254
run: cargo binstall dioxus-cli@0.7.2 --disable-telemetry --locked --force -y
5355
env:
5456
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -153,6 +155,10 @@ jobs:
153155
- name: Bundle (macOS)
154156
if: runner.os == 'macOS'
155157
working-directory: ./ui
158+
env:
159+
# Baked into the binary via `option_env!("SENTRY_DSN")` in ui/src/main.rs.
160+
# If the secret isn't set the binary just runs without Sentry reporting.
161+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
156162
run: dx bundle --locked --desktop --release --package-types macos
157163

158164
- name: Build DMG (appdmg)
@@ -182,6 +188,26 @@ jobs:
182188
fi
183189
codesign --force --sign "$APPLE_SIGNING_IDENTITY" --timestamp ui/dist/Datum.dmg
184190
191+
- name: Generate dSYM (macOS)
192+
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/v')
193+
run: |
194+
# `debug = "line-tables-only"` in workspace Cargo.toml leaves DWARF
195+
# distributed across the `.o` files in target/<triple>/<profile>/deps/
196+
# with only N_OSO references in the binary. Without a .dSYM bundle
197+
# sentry-cli has nothing to symbolicate against on macOS, so we run
198+
# dsymutil manually and stage the result outside the .app bundle so
199+
# it doesn't get packaged into the DMG.
200+
BIN="ui/target/dx/Datum/release/macos/Datum.app/Contents/MacOS/Datum"
201+
DSYM_DIR="$RUNNER_TEMP/dsyms"
202+
mkdir -p "$DSYM_DIR"
203+
if [ ! -f "$BIN" ]; then
204+
echo "Bundled binary not found at $BIN" >&2
205+
exit 1
206+
fi
207+
dsymutil "$BIN" -o "$DSYM_DIR/Datum.dSYM"
208+
ls -la "$DSYM_DIR/Datum.dSYM"
209+
dwarfdump --uuid "$DSYM_DIR/Datum.dSYM"
210+
185211
- name: Upload Debug Symbols to Sentry (macOS)
186212
if: runner.os == 'macOS' && startsWith(github.ref, 'refs/tags/v')
187213
env:
@@ -196,6 +222,7 @@ jobs:
196222
export PATH="$INSTALL_DIR:$PATH"
197223
curl -sL https://sentry.io/get-cli/ | SENTRY_CLI_VERSION=3.2.3 sh
198224
sentry-cli debug-files upload --include-sources \
225+
"$RUNNER_TEMP/dsyms" \
199226
ui/target/dx/Datum/release/macos/Datum.app/Contents/MacOS/
200227
else
201228
echo "SENTRY_AUTH_TOKEN not set, skipping debug symbol upload"
@@ -255,6 +282,8 @@ jobs:
255282
# For now we set NO_STRIP, which makes the bundles *huge*...
256283
env:
257284
NO_STRIP: true
285+
# Baked into the binary via `option_env!("SENTRY_DSN")` in ui/src/main.rs.
286+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
258287
run: dx bundle --locked --desktop --release --package-types appimage
259288

260289
- name: Repack AppImage using system libs (Linux)
@@ -390,6 +419,9 @@ jobs:
390419
- name: Bundle (Windows)
391420
working-directory: ./ui
392421
if: runner.os == 'Windows'
422+
env:
423+
# Baked into the binary via `option_env!("SENTRY_DSN")` in ui/src/main.rs.
424+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
393425
run: dx bundle --locked --desktop --release --package-types nsis
394426

395427
- name: Upload Debug Symbols to Sentry (Windows)

.github/workflows/manual-release.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ jobs:
5050
libxdo-dev
5151
5252
- name: Install Dioxus CLI
53-
# Should be pinned to same version as dioxus in Cargo.toml
54-
# note: dx bundle on Windows fails with 0.7.3, see
53+
# Library deps in ui/Cargo.toml are pinned to dioxus =0.7.9, but the CLI is
54+
# held back at 0.7.2 because dx bundle path resolution regressed in 0.7.3+
55+
# and the upstream fix is still open:
5556
# https://github.com/DioxusLabs/dioxus/issues/5233
57+
# Bump in lockstep with the lib once that issue is resolved.
5658
run: cargo binstall dioxus-cli@0.7.2 --disable-telemetry --locked --force -y
5759
env:
5860
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -139,6 +141,10 @@ jobs:
139141
- name: Bundle (macOS)
140142
if: runner.os == 'macOS'
141143
working-directory: ./ui
144+
env:
145+
# Baked into the binary via `option_env!("SENTRY_DSN")` in ui/src/main.rs.
146+
# If the secret isn't set the binary just runs without Sentry reporting.
147+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
142148
run: dx bundle --locked --desktop --release --package-types macos
143149

144150
- name: Build DMG (appdmg)
@@ -215,6 +221,8 @@ jobs:
215221
# For now we set NO_STRIP, which makes the bundles *huge*...
216222
env:
217223
NO_STRIP: true
224+
# Baked into the binary via `option_env!("SENTRY_DSN")` in ui/src/main.rs.
225+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
218226
run: dx bundle --locked --desktop --release --package-types appimage
219227

220228
- name: Repack AppImage using system libs (Linux)
@@ -314,6 +322,9 @@ jobs:
314322
- name: Bundle (Windows)
315323
working-directory: ./ui
316324
if: runner.os == 'Windows'
325+
env:
326+
# Baked into the binary via `option_env!("SENTRY_DSN")` in ui/src/main.rs.
327+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
317328
run: dx bundle --locked --desktop --release --package-types nsis
318329

319330
- name: Upload artifacts

0 commit comments

Comments
 (0)