mirror of
https://github.com/tinyhumansai/openhuman.git
synced 2026-07-28 13:32:23 +00:00
- Flip `app/src-tauri/Cargo.toml` `default = ["cef"]` (wry is now opt-in via `--no-default-features --features wry`). `cef-dll-sys` auto-downloads the Chromium runtime per-target at compile time. - Update dev scripts: `dev:app` now uses CEF + keychain safe-storage setup; `dev:cef` aliased to it; new `dev:wry` for opt-out; `macos:build:*` and `tauri:build:ui` switched to `cargo tauri` so the CEF-aware bundler runs. - Replace `tauri-apps/tauri-action@v0.6.2` / `yarn tauri build` with `cargo tauri build` in `build.yml`, `build-windows.yml`, and `release.yml`. The upstream `@tauri-apps/cli` binary does not bundle CEF framework files into the produced installer — only the fork at `vendor/tauri-cef` does, so workflows must use the fork's CLI or the shipped apps fail to launch. - Bake the CEF-aware `cargo-tauri` into `ghcr.io/tinyhumansai/openhuman_ci` by compiling it from the submodule during Docker image build, plus CEF runtime libs (libnss3, libgbm1, libxshmfence1, …). Skips the per-run cargo-install in the container-based `build.yml`. - Cache CEF downloads per-OS in matrix jobs (~400MB/platform) and cache the compiled `cargo-tauri` binary on raw GH runners (build-windows, release). - Explicit `gh release upload` step for Linux + Windows installers since the tauri-action upload path was removed; macOS keeps its existing re-sign + notarize + re-upload flow.
90 lines
2.9 KiB
YAML
90 lines
2.9 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
|
|
permissions:
|
|
contents: read
|
|
pull-requests: read
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.head_ref || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build Tauri App
|
|
runs-on: ubuntu-22.04
|
|
container:
|
|
image: ghcr.io/tinyhumansai/openhuman_ci:rust-1.93.0
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
submodules: recursive
|
|
|
|
- name: Cache Rust build artifacts
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
workspaces: |
|
|
. -> target
|
|
app/src-tauri -> target
|
|
cache-on-failure: true
|
|
|
|
# CEF (Chromium Embedded Framework) runtime is downloaded on-demand by
|
|
# cef-dll-sys + the vendored tauri-cli. Cache it across builds — the
|
|
# payload is ~400MB per platform and fetching every run is painful.
|
|
- name: Cache CEF binary distribution
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.cache/tauri-cef
|
|
key: cef-ubuntu-22.04-${{ hashFiles('app/src-tauri/Cargo.toml') }}
|
|
restore-keys: |
|
|
cef-ubuntu-22.04-
|
|
|
|
# Note: the vendored CEF-aware tauri-cli is pre-installed in the
|
|
# ghcr.io/tinyhumansai/openhuman_ci image (see .github/Dockerfile),
|
|
# so `cargo tauri build` below resolves to the fork without any
|
|
# per-run compile step.
|
|
|
|
- name: Cache node modules
|
|
id: yarn-cache
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-build-${{ hashFiles('**/yarn.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-
|
|
|
|
- name: Install dependencies
|
|
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
run: yarn install --frozen-lockfile
|
|
|
|
- name: Install cmake (for whisper-rs)
|
|
run: apt-get update && apt-get install -y --no-install-recommends cmake && rm -rf /var/lib/apt/lists/*
|
|
|
|
- name: Build sidecar core binary
|
|
run: cargo build --profile ci --target x86_64-unknown-linux-gnu --bin openhuman-core
|
|
|
|
- name: Stage sidecar for Tauri bundler
|
|
run: |
|
|
mkdir -p app/src-tauri/binaries
|
|
cp target/x86_64-unknown-linux-gnu/ci/openhuman-core app/src-tauri/binaries/openhuman-core-x86_64-unknown-linux-gnu
|
|
chmod +x app/src-tauri/binaries/openhuman-core-x86_64-unknown-linux-gnu
|
|
|
|
- name: Build Tauri app (CEF default)
|
|
working-directory: app
|
|
run: |
|
|
TAURI_CONFIG_OVERRIDE='{"plugins":{"updater":{"active":false}}}'
|
|
cargo tauri build -c "$TAURI_CONFIG_OVERRIDE" --bundles deb
|
|
env:
|
|
NODE_ENV: production
|
|
CARGO_PROFILE_RELEASE_OPT_LEVEL: "1"
|
|
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "16"
|
|
CARGO_PROFILE_RELEASE_LTO: "false"
|
|
CARGO_PROFILE_RELEASE_STRIP: "true"
|
|
CARGO_PROFILE_RELEASE_DEBUG: "false"
|