135 lines
4.3 KiB
YAML
135 lines
4.3 KiB
YAML
name: Desktop CI Build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- main
|
|
- feat/embed-desktop
|
|
paths:
|
|
- ".github/workflows/desktop-ci-build.yml"
|
|
- "desktop/**"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
RUST_BACKTRACE: short
|
|
NODE_OPTIONS: "--max_old_space_size=4096"
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
build:
|
|
name: Build ${{ matrix.name }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- name: macOS ARM64 DMG
|
|
os: macos-14
|
|
target: aarch64-apple-darwin
|
|
artifact_name: BoosAPI-Desktop-macos-arm64-dmg
|
|
artifact_path: desktop/src-tauri/target/aarch64-apple-darwin/release/bundle/dmg/*.dmg
|
|
tauri_args: --target aarch64-apple-darwin --bundles dmg
|
|
- name: Windows x64
|
|
os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
artifact_name: BoosAPI-Desktop-windows-x64
|
|
artifact_path: |
|
|
desktop/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/msi/*.msi
|
|
desktop/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis/*.exe
|
|
desktop/src-tauri/target/x86_64-pc-windows-msvc/release/BoosApi.exe
|
|
tauri_args: --target x86_64-pc-windows-msvc
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install Rust
|
|
uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
|
|
- name: Rust cache
|
|
uses: Swatinem/rust-cache@v2
|
|
with:
|
|
prefix-key: "v1"
|
|
key: "${{ runner.os }}-${{ matrix.target }}-desktop-bun"
|
|
workspaces: desktop/src-tauri -> target
|
|
|
|
- name: Install Protoc
|
|
uses: arduino/setup-protoc@v3
|
|
with:
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Setup Bun
|
|
uses: oven-sh/setup-bun@v2
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: Setup pnpm
|
|
uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 10.32.1
|
|
run_install: false
|
|
|
|
- name: Get linked dependency versions
|
|
id: dep-versions
|
|
shell: bash
|
|
working-directory: desktop
|
|
run: |
|
|
SM_SHA=$(git -C libs/stream-monaco rev-parse HEAD)
|
|
MS_SHA=$(git -C libs/markstream-vue rev-parse HEAD)
|
|
echo "cache-key=${{ runner.os }}-${{ matrix.target }}-desktop-linked-deps-${SM_SHA:0:12}-${MS_SHA:0:12}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Cache linked dependencies
|
|
id: cache-linked-deps
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
desktop/libs/stream-monaco/node_modules
|
|
desktop/libs/stream-monaco/dist
|
|
desktop/libs/markstream-vue/node_modules
|
|
desktop/libs/markstream-vue/packages/markdown-parser/node_modules
|
|
desktop/libs/markstream-vue/packages/markdown-parser/dist
|
|
desktop/libs/markstream-vue/packages/markstream-react/node_modules
|
|
desktop/libs/markstream-vue/packages/markstream-react/dist
|
|
key: ${{ steps.dep-versions.outputs.cache-key }}
|
|
|
|
- name: Build linked dependencies
|
|
if: steps.cache-linked-deps.outputs.cache-hit != 'true'
|
|
shell: bash
|
|
working-directory: desktop
|
|
run: |
|
|
pnpm --dir libs/stream-monaco install --frozen-lockfile
|
|
pnpm --dir libs/stream-monaco run build
|
|
|
|
pnpm --dir libs/markstream-vue install --frozen-lockfile
|
|
pnpm --dir libs/markstream-vue run build:parser
|
|
pnpm --dir libs/markstream-vue/packages/markstream-react run build
|
|
|
|
- name: Install frontend dependencies
|
|
working-directory: desktop
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build Desktop
|
|
working-directory: desktop
|
|
env:
|
|
APPLE_SIGNING_IDENTITY: ${{ startsWith(matrix.os, 'macos') && '-' || '' }}
|
|
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
|
run: bun run tauri build ${{ matrix.tauri_args }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.artifact_name }}
|
|
path: ${{ matrix.artifact_path }}
|
|
if-no-files-found: error
|