Skip to content

Build Test

Build Test #51

Workflow file for this run

name: Build Test
on:
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
name: macos-arm64
args: --target aarch64-apple-darwin --verbose
- os: macos-latest
target: x86_64-apple-darwin
name: macos-x64
args: --target x86_64-apple-darwin --verbose
- os: windows-latest
target: x86_64-pc-windows-msvc
name: windows
args: --target x86_64-pc-windows-msvc --verbose
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
name: linux
args: --target x86_64-unknown-linux-gnu --bundles deb,rpm --verbose
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24
cache: pnpm
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install Linux dependencies
if: matrix.os == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev patchelf libxdo-dev libssl-dev libgtk-3-dev pkg-config libfuse2 squashfs-tools
- run: pnpm install
- name: Build MCP server binary
shell: bash
run: |
curl -fsSL https://bun.sh/install | bash
export BUN_INSTALL="$HOME/.bun"
export PATH="$BUN_INSTALL/bin:$PATH"
cd mcp-server && bun install
TARGET="${{ matrix.target }}"
mkdir -p ../src-tauri/binaries
if [[ "$TARGET" == "x86_64-apple-darwin" ]]; then
bun build --compile --target=bun-darwin-x64 src/index.ts --outfile ../src-tauri/binaries/mermaid-code-mcp-x86_64-apple-darwin
elif [[ "$TARGET" == "aarch64-apple-darwin" ]]; then
bun build --compile --target=bun-darwin-arm64 src/index.ts --outfile ../src-tauri/binaries/mermaid-code-mcp-aarch64-apple-darwin
elif [[ "$TARGET" == "x86_64-pc-windows-msvc" ]]; then
bun build --compile --target=bun-windows-x64 src/index.ts --outfile ../src-tauri/binaries/mermaid-code-mcp-x86_64-pc-windows-msvc.exe
elif [[ "$TARGET" == "x86_64-unknown-linux-gnu" ]]; then
bun build --compile --target=bun-linux-x64 src/index.ts --outfile ../src-tauri/binaries/mermaid-code-mcp-x86_64-unknown-linux-gnu
fi
- name: Build Tauri app
uses: tauri-apps/tauri-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD || '' }}
APPIMAGE_EXTRACT_AND_RUN: 1
with:
args: ${{ matrix.args }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: mermaid-code-${{ matrix.name }}
path: |
src-tauri/target/${{ matrix.target }}/release/bundle/deb/*.deb
src-tauri/target/${{ matrix.target }}/release/bundle/rpm/*.rpm
src-tauri/target/${{ matrix.target }}/release/bundle/appimage/*.AppImage
src-tauri/target/${{ matrix.target }}/release/bundle/dmg/*.dmg
src-tauri/target/${{ matrix.target }}/release/bundle/macos/*.app.tar.gz
src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*.exe
retention-days: 3