Flesh out build-from-source instructions with ONNX Runtime steps #23
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| tags: ["v*"] | |
| pull_request: | |
| branches: [master] | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| - uses: swatinem/rust-cache@v2 | |
| - name: Check formatting | |
| run: cargo fmt -- --check | |
| - name: Clippy | |
| run: cargo clippy -- -D warnings | |
| - name: Run tests | |
| run: cargo test | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| needs: test | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: macos-latest | |
| rust_target: aarch64-apple-darwin | |
| ort_arch: osx-arm64 | |
| dist_name: orunla-mac-aarch64 | |
| - platform: macos-15-intel | |
| rust_target: x86_64-apple-darwin | |
| ort_arch: osx-x86_64 | |
| dist_name: orunla-mac-x86_64 | |
| - platform: windows-latest | |
| rust_target: x86_64-pc-windows-msvc | |
| ort_arch: win-x64 | |
| dist_name: orunla-windows | |
| runs-on: ${{ matrix.platform }} | |
| env: | |
| ORT_VERSION: "1.20.0" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| # Windows: fix broken MSVC link.exe path (actions/runner-images#12432) | |
| - name: Configure lld-link for Windows | |
| if: runner.os == 'Windows' | |
| shell: bash | |
| run: | | |
| mkdir -p src-tauri/.cargo | |
| cat > src-tauri/.cargo/config.toml << 'EOF' | |
| [target.x86_64-pc-windows-msvc] | |
| linker = "lld-link" | |
| EOF | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.rust_target }} | |
| - name: Rust cache | |
| uses: swatinem/rust-cache@v2 | |
| with: | |
| workspaces: "./src-tauri -> target" | |
| - name: Install npm dependencies | |
| run: npm ci | |
| # ── Download ONNX Runtime ────────────────────────────────────────── | |
| - name: Download ONNX Runtime (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| ORT_ARCHIVE="onnxruntime-${{ matrix.ort_arch }}-${ORT_VERSION}.tgz" | |
| ORT_URL="https://github.com/microsoft/onnxruntime/releases/download/v${ORT_VERSION}/${ORT_ARCHIVE}" | |
| echo "Downloading ONNX Runtime from ${ORT_URL}..." | |
| curl -sL "${ORT_URL}" -o "${ORT_ARCHIVE}" | |
| tar xzf "${ORT_ARCHIVE}" | |
| mkdir -p src-tauri/resources | |
| cp "onnxruntime-${{ matrix.ort_arch }}-${ORT_VERSION}/lib/libonnxruntime.${ORT_VERSION}.dylib" \ | |
| src-tauri/resources/libonnxruntime.dylib | |
| ls -la src-tauri/resources/ | |
| - name: Download ONNX Runtime (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $ORT_ARCHIVE = "onnxruntime-${{ matrix.ort_arch }}-${{ env.ORT_VERSION }}.zip" | |
| $ORT_URL = "https://github.com/microsoft/onnxruntime/releases/download/v${{ env.ORT_VERSION }}/$ORT_ARCHIVE" | |
| Write-Host "Downloading ONNX Runtime from $ORT_URL..." | |
| Invoke-WebRequest -Uri $ORT_URL -OutFile $ORT_ARCHIVE | |
| Expand-Archive -Path $ORT_ARCHIVE -DestinationPath "ort-extract" | |
| New-Item -ItemType Directory -Force -Path "src-tauri\resources" | Out-Null | |
| Copy-Item "ort-extract\onnxruntime-${{ matrix.ort_arch }}-${{ env.ORT_VERSION }}\lib\onnxruntime.dll" ` | |
| "src-tauri\resources\onnxruntime.dll" | |
| Get-ChildItem "src-tauri\resources\" | |
| # macOS: patch tauri.conf.json to reference dylib instead of dll | |
| - name: Patch tauri.conf.json for macOS | |
| if: runner.os == 'macOS' | |
| run: | | |
| sed -i '' 's|resources/onnxruntime.dll|resources/libonnxruntime.dylib|' src-tauri/tauri.conf.json | |
| # ── Build Tauri desktop app ──────────────────────────────────────── | |
| - name: Build Tauri app | |
| uses: tauri-apps/tauri-action@v0 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tagName: ${{ github.ref_name }} | |
| releaseName: "Orunla ${{ github.ref_name }}" | |
| releaseBody: | | |
| Orunla Memory System release. | |
| **macOS Apple Silicon (M1-M4):** Download `orunla-mac-aarch64.zip` | |
| **macOS Intel:** Download `orunla-mac-x86_64.zip` | |
| **Windows:** Download `orunla-windows.zip` | |
| Each zip contains the desktop app, CLI, MCP server, ONNX runtime, and documentation. | |
| > macOS unsigned build: Right-click the app > Open to bypass Gatekeeper on first launch. | |
| releaseDraft: false | |
| prerelease: false | |
| args: --target ${{ matrix.rust_target }} | |
| # ── Build CLI and MCP binaries ───────────────────────────────────── | |
| - name: Build CLI and MCP binaries | |
| run: | | |
| cargo build --release --target ${{ matrix.rust_target }} --bin orunla_cli | |
| cargo build --release --target ${{ matrix.rust_target }} --bin orunla_mcp | |
| # ── Package full distribution zip ────────────────────────────────── | |
| - name: Package distribution (macOS) | |
| if: runner.os == 'macOS' | |
| run: | | |
| DIST="${{ matrix.dist_name }}" | |
| mkdir -p "${DIST}/docs" | |
| # Binaries | |
| cp "target/${{ matrix.rust_target }}/release/orunla_cli" "${DIST}/" | |
| cp "target/${{ matrix.rust_target }}/release/orunla_mcp" "${DIST}/" | |
| # ONNX Runtime | |
| cp "src-tauri/resources/libonnxruntime.dylib" "${DIST}/" | |
| # UI | |
| mkdir -p "${DIST}/ui" | |
| cp ui/index.html "${DIST}/ui/" | |
| cp ui/main.js "${DIST}/ui/" | |
| # Documentation | |
| cp README.md "${DIST}/" | |
| cp LICENSE "${DIST}/" | |
| for doc in docs/CLI.md docs/MCP.md docs/API_REFERENCE.md docs/AI_SETUP.md docs/OVERVIEW.md docs/DEVELOPER.md docs/THIRD_PARTY_NOTICES.md; do | |
| [ -f "$doc" ] && cp "$doc" "${DIST}/docs/" | |
| done | |
| # Zip | |
| zip -r "${DIST}.zip" "${DIST}/" | |
| echo "Packaged ${DIST}.zip:" | |
| ls -la "${DIST}.zip" | |
| - name: Package distribution (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $DIST = "${{ matrix.dist_name }}" | |
| New-Item -ItemType Directory -Force -Path "$DIST\docs" | Out-Null | |
| # Binaries | |
| Copy-Item "target\${{ matrix.rust_target }}\release\orunla_cli.exe" "$DIST\" | |
| Copy-Item "target\${{ matrix.rust_target }}\release\orunla_mcp.exe" "$DIST\" | |
| # Desktop app (built by tauri-action) | |
| $tauriExe = Get-ChildItem -Path "src-tauri\target\${{ matrix.rust_target }}\release" -Filter "*.exe" | | |
| Where-Object { $_.Name -eq "app.exe" -or $_.Name -eq "Orunla.exe" } | | |
| Select-Object -First 1 | |
| if ($tauriExe) { | |
| Copy-Item $tauriExe.FullName "$DIST\Orunla.exe" | |
| } | |
| # ONNX Runtime | |
| Copy-Item "src-tauri\resources\onnxruntime.dll" "$DIST\" | |
| # Documentation | |
| Copy-Item "README.md" "$DIST\" | |
| Copy-Item "LICENSE" "$DIST\" | |
| $docs = @("docs\CLI.md", "docs\MCP.md", "docs\API_REFERENCE.md", "docs\AI_SETUP.md", "docs\OVERVIEW.md", "docs\DEVELOPER.md", "docs\THIRD_PARTY_NOTICES.md") | |
| foreach ($doc in $docs) { | |
| if (Test-Path $doc) { Copy-Item $doc "$DIST\docs\" } | |
| } | |
| # Zip | |
| Compress-Archive -Path "$DIST\*" -DestinationPath "$DIST.zip" -Force | |
| Write-Host "Packaged ${DIST}.zip:" | |
| Get-ChildItem "$DIST.zip" | |
| # Upload dist zip to the release | |
| - name: Upload distribution zip | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| shell: bash | |
| run: | | |
| TAG="${{ github.ref_name }}" | |
| gh release upload "$TAG" "${{ matrix.dist_name }}.zip" --clobber |