diff --git a/.gitea/workflows/build-app.yml b/.gitea/workflows/build-app.yml index e3f9047..897c848 100644 --- a/.gitea/workflows/build-app.yml +++ b/.gitea/workflows/build-app.yml @@ -122,6 +122,18 @@ jobs: build-macos: runs-on: macos-latest steps: + - name: Install Node.js + run: | + if command -v node &>/dev/null; then + echo "Node.js already installed: $(node --version)" + else + echo "Installing Node.js 22 via Homebrew..." + brew install node@22 + brew link --overwrite node@22 + fi + node --version + npm --version + - name: Checkout uses: actions/checkout@v4 with: @@ -144,19 +156,17 @@ jobs: echo "Patched version to ${VERSION}" - name: Install Rust stable - uses: dtolnay/rust-toolchain@stable - with: - targets: aarch64-apple-darwin,x86_64-apple-darwin - - - name: Rust cache - uses: swatinem/rust-cache@v2 - with: - workspaces: "./app/src-tauri -> target" - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: "22" + run: | + if command -v rustup &>/dev/null; then + rustup update stable + rustup default stable + else + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable + . "$HOME/.cargo/env" + fi + rustup target add aarch64-apple-darwin x86_64-apple-darwin + rustc --version + cargo --version - name: Install frontend dependencies working-directory: ./app @@ -168,6 +178,8 @@ jobs: - name: Build Tauri app (universal) working-directory: ./app + env: + PATH: ${{ format('{0}/.cargo/bin:{1}', env.HOME, env.PATH) }} run: npx tauri build --target universal-apple-darwin - name: Collect artifacts diff --git a/BUILDING.md b/BUILDING.md index 3b0895b..2d3580a 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,6 +1,6 @@ # Building Triple-C -Triple-C is a Tauri v2 desktop application with a React/TypeScript frontend and a Rust backend. This guide covers building the app from source on Linux and Windows. +Triple-C is a Tauri v2 desktop application with a React/TypeScript frontend and a Rust backend. This guide covers building the app from source on Linux, macOS, and Windows. ## Prerequisites (All Platforms) @@ -79,6 +79,57 @@ Build artifacts are located in `app/src-tauri/target/release/bundle/`: | Debian pkg | `deb/*.deb` | | RPM pkg | `rpm/*.rpm` | +## macOS + +### 1. Install prerequisites + +- **Xcode Command Line Tools** — required for the C/C++ toolchain and system headers: + +```bash +xcode-select --install +``` + +No additional system libraries are needed — macOS includes WebKit natively. + +### 2. Install Rust targets (universal binary) + +To build a universal binary that runs on both Apple Silicon and Intel Macs: + +```bash +rustup target add aarch64-apple-darwin x86_64-apple-darwin +``` + +### 3. Install frontend dependencies + +```bash +cd app +npm ci +``` + +### 4. Build + +For a universal binary (recommended for distribution): + +```bash +npx tauri build --target universal-apple-darwin +``` + +For the current architecture only (faster, for local development): + +```bash +npx tauri build +``` + +Build artifacts are located in `app/src-tauri/target/universal-apple-darwin/release/bundle/` (or `target/release/bundle/` for single-arch builds): + +| Format | Path | +|--------|------| +| DMG | `dmg/*.dmg` | +| macOS App | `macos/*.app` | +| macOS App (compressed) | `macos/*.app.tar.gz` | + +> **Note:** The app is not signed or notarized. On first launch, macOS Gatekeeper may block it. Right-click the app and select "Open" to bypass, or remove the quarantine attribute: `xattr -cr /Applications/Triple-C.app` + ## Windows ### 1. Install prerequisites