Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

build debug symbols

Brendan Allan3a04ee419237
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
index ac3c29a89..c5241992b 100644
--- a/.github/workflows/publish.yml
+++ b/.github/workflows/publish.yml
@@ -6,6 +6,8 @@ on: workflow_dispatch
env:
CN_APPLICATION: cap/cap
APP_CARGO_TOML: apps/desktop/src-tauri/Cargo.toml
+ SENTRY_ORG: cap-s2
+ SENTRY_PROJECT: cap-desktop
jobs:
draft:
@@ -134,7 +136,7 @@ jobs:
echo 'VITE_SERVER_URL=${NEXT_PUBLIC_URL}' >> .env
echo "NEXT_PUBLIC_CAP_AWS_REGION=${{ secrets.NEXT_PUBLIC_CAP_AWS_REGION }}" >> .env
echo "NEXT_PUBLIC_CAP_AWS_BUCKET=${{ secrets.NEXT_PUBLIC_CAP_AWS_BUCKET }}" >> .env
-
+
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env
@@ -144,7 +146,7 @@ jobs:
- name: Cargo clean
run: cargo clean
- - name: Build MacOS Apps
+ - name: Build macOS apps
working-directory: apps/desktop
run: |
export TARGET_TRIPLE=${{ matrix.settings.target }}
@@ -166,8 +168,16 @@ jobs:
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
- - name: upload assets
+ - name: Upload assets
uses: crabnebula-dev/cloud-release@v0
with:
command: release upload ${{ env.CN_APPLICATION }} "${{ needs.draft.outputs.version }}" --framework tauri
api-key: ${{ secrets.CN_API_KEY }}
+
+ - name: Upload debug symbols to Sentry
+ env:
+ SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
+ working-directory: target/release
+ run: |
+ curl -sL https://sentry.io/get-cli/ | bash
+ sentry-cli debug-files upload -o ${{ env.SENTRY_ORG }} -p ${{ env.SENTRY_PROJECT }} Cap.dSYM
diff --git a/apps/desktop/scripts/stripDebugSymbols.js b/apps/desktop/scripts/stripDebugSymbols.js
new file mode 100644
index 000000000..f3803054e
--- /dev/null
+++ b/apps/desktop/scripts/stripDebugSymbols.js
@@ -0,0 +1,26 @@
+import * as fs from "node:fs/promises";
+import * as path from "node:path";
+import { fileURLToPath } from "node:url";
+import { exec as execCb } from "node:child_process";
+import { promisify } from "node:util";
+
+const exec = promisify(execCb);
+
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+const targetDir = path.join(__dirname, "../../../target");
+const releaseDir = path.join(targetDir, "release");
+
+async function main() {
+ const releaseFiles = await fs.readdir(releaseDir);
+ const binaryPath = path.join(
+ releaseDir,
+ releaseFiles.find((f) => f.startsWith("Cap"))
+ );
+
+ await exec(`dsymutil "${binaryPath}" -o "${binaryPath}.dSYM"`);
+ await exec(`strip "${binaryPath}"`);
+}
+
+main();
diff --git a/apps/desktop/src-tauri/Cargo.toml b/apps/desktop/src-tauri/Cargo.toml
index d5f90e96f..cafd5c59c 100644
--- a/apps/desktop/src-tauri/Cargo.toml
+++ b/apps/desktop/src-tauri/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "desktop"
-version = "0.3.2"
+version = "0.3.3"
description = "Beautiful screen recordings, owned by you."
authors = ["you"]
edition = "2021"
@@ -65,7 +65,7 @@ global-hotkey = "0.6.3"
rand = "0.8.5"
cpal.workspace = true
keyed_priority_queue = "0.4.2"
-sentry.workspace = true
+sentry = { workspace = true }
cap-utils = { path = "../../../crates/utils" }
cap-project = { path = "../../../crates/project" }
@@ -106,4 +106,4 @@ panic = "abort" # Strip expensive panic clean-up logic
codegen-units = 1 # Compile crates one after another so the compiler can optimize better
lto = true # Enables link to optimizations
opt-level = "s" # Optimize for binary size
-strip = true # Remove debug symbols
+debug = true