Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Release CI for Solid version

Atila Fassina71c90de5f36a
diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml
new file mode 100644
index 000000000..5524b4909
--- /dev/null
+++ b/.github/workflows/publish.yml
@@ -0,0 +1,92 @@
+name: "publish"
+
+# change this when ready to release if you want CI/CD
+on: workflow_dispatch
+
+env:
+ CN_APPLICATION: cap/cap
+
+jobs:
+ cap-desktop-release:
+ permissions:
+ contents: write
+ runs-on: macos-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v4
+
+ - name: Get app version
+ id: get_version
+ run: echo "appVersion=$(jq -r '.version' apps/desktop/package.json)" >> $GITHUB_OUTPUT
+
+ - name: create daft release
+ uses: crabnebula-dev/cloud-release@v0
+ with:
+ command: release draft ${{ env.CN_APPLICATION }} ${{ steps.get_version.outputs.appVersion }} --framework tauri
+ api-key: ${{ secrets.CN_API_KEY }}
+
+ - name: Create API Key File
+ run: echo "${{ secrets.APPLE_API_KEY_FILE }}" > api.p8
+
+ - name: Rust setup
+ uses: actions-rust-lang/setup-rust-toolchain@v1
+ with:
+ toolchain: stable
+ cache: true
+
+ - name: Setup pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: 9
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ node-version: "20"
+
+ - name: Install dependencies
+ run: cd apps/desktop-solid && pnpm install
+
+ - name: Create .env file in root
+ run: |
+ echo "appVersion=${{ steps.get_version.outputs.appVersion }}" >> .env
+ echo "CAP_DESKTOP_SENTRY_URL=https://efd3156d9c0a8a49bee3ee675bec80d8@o4506859771527168.ingest.us.sentry.io/4506859844403200" >> .env
+
+ - name: Copy .env to apps/desktop-solid
+ run: cp .env apps/desktop-solid/.env
+
+ - name: Output .env file
+ run: cat apps/desktop-solid/.env
+
+ - name: Build MacOS Apps
+ # Install x86_64-apple-darwin for mac and build Tauri binaries
+ # Build both intel and apple silicon
+ working-directory: apps/desktop-solid
+ run: |
+ rustup target add x86_64-apple-darwin
+ pnpm install
+ pnpm tauri build -- --target x86_64-apple-darwin
+ pnpm tauri build -- --target aarch64-apple-darwin
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
+ APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
+ APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
+ APPLE_ID: ${{ secrets.APPLE_ID }}
+ APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
+ APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
+ APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
+ APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
+ APPLE_API_KEY_PATH: api.p8
+
+ # using the same keys as v1
+ TAURI_PRIVATE_SIGNING_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
+ TAURI_KEY_SIGNING_PASSWORD: ${{ secrets.TAURI_KEY_SIGNING_PASSWORD }}
+
+ - name: upload assets
+ uses: crabnebula-dev/cloud-release@v0
+ with:
+ command: release upload ${{ env.CN_APPLICATION }} --framework tauri
+ api-key: ${{ secrets.CN_API_KEY }}
+ path: ./apps/desktop-solid/src-tauri
diff --git a/apps/desktop-solid/src-tauri/Cargo.toml b/apps/desktop-solid/src-tauri/Cargo.toml
index af013bdad..a3dce0c06 100644
--- a/apps/desktop-solid/src-tauri/Cargo.toml
+++ b/apps/desktop-solid/src-tauri/Cargo.toml
@@ -64,3 +64,11 @@ cpal = "0.15.3"
indexmap = "2.5.0"
num-traits = "0.2.19"
tempfile = "3.12.0"
+
+# Optimize for smaller binary size
+[profile.release]
+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
\ No newline at end of file
diff --git a/apps/desktop-solid/src-tauri/tauri.conf.json b/apps/desktop-solid/src-tauri/tauri.conf.json
index 7a95cceb8..e92dc1e45 100644
--- a/apps/desktop-solid/src-tauri/tauri.conf.json
+++ b/apps/desktop-solid/src-tauri/tauri.conf.json
@@ -1,4 +1,5 @@
{
+ "$schema": "../node_modules/@tauri-apps/cli/schema.json",
"productName": "desktop-solid",
"version": "0.1.0",
"identifier": "so.cap.desktop-solid",