-
Notifications
You must be signed in to change notification settings - Fork 104
148 lines (137 loc) · 6.15 KB
/
build-calm-studio-desktop.yml
File metadata and controls
148 lines (137 loc) · 6.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Build CALM Studio Desktop
permissions:
contents: write
on:
push:
tags:
- 'calm-studio-v*'
workflow_dispatch:
inputs:
draft:
description: 'Create as draft release'
type: boolean
default: true
defaults:
run:
working-directory: calm-suite/calm-studio
jobs:
build-sidecar:
name: Build MCP Sidecar (${{ matrix.target }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
target: node20-macos-arm64
triple: aarch64-apple-darwin
- os: macos-13
target: node20-macos-x64
triple: x86_64-apple-darwin
- os: ubuntu-22.04
target: node20-linux-x64
triple: x86_64-unknown-linux-gnu
- os: windows-latest
target: node20-win-x64
triple: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @calmstudio/calm-core build
- name: Build sidecar
run: |
cd packages/mcp-server
pnpm build:bundle
pnpm dlx @yao-pkg/pkg dist/bundle.cjs --target ${{ matrix.target }} --output dist/calmstudio-mcp
- name: Rename with target triple
shell: bash
run: |
cd packages/mcp-server/dist
if [ "${{ runner.os }}" = "Windows" ]; then
mv calmstudio-mcp.exe calmstudio-mcp-${{ matrix.triple }}.exe
else
mv calmstudio-mcp calmstudio-mcp-${{ matrix.triple }}
fi
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: sidecar-${{ matrix.triple }}
path: calm-suite/calm-studio/packages/mcp-server/dist/calmstudio-mcp-*
build-desktop:
name: Build Desktop (${{ matrix.triple }})
needs: build-sidecar
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: macos-latest
args: --target aarch64-apple-darwin
triple: aarch64-apple-darwin
- os: macos-13
args: --target x86_64-apple-darwin
triple: x86_64-apple-darwin
- os: ubuntu-22.04
args: ''
triple: x86_64-unknown-linux-gnu
- os: windows-latest
args: ''
triple: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: pnpm/action-setup@b906affcce14559ad1aafd4ab0e942779e9f58b1 # v4
with:
version: 9
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 22
cache: pnpm
cache-dependency-path: calm-suite/calm-studio/pnpm-lock.yaml
- run: cd calm-suite/calm-studio && pnpm install --frozen-lockfile
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: Install Rust
uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
targets: ${{ matrix.triple }}
- name: Rust cache
uses: swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
workspaces: calm-suite/calm-studio/apps/studio/src-tauri
- name: Download sidecar binary
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: sidecar-${{ matrix.triple }}
path: calm-suite/calm-studio/apps/studio/src-tauri/binaries/
- name: Make sidecar executable
if: runner.os != 'Windows'
run: chmod +x apps/studio/src-tauri/binaries/calmstudio-mcp-*
- name: Build desktop app
uses: tauri-apps/tauri-action@84b9d35b5fc46c1e45415bdb6144030364f7ebc5 # v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
with:
projectPath: calm-suite/calm-studio/apps/studio
tauriScript: pnpm tauri
args: ${{ matrix.args }}
tagName: ${{ github.ref_name }}
releaseName: 'CalmStudio ${{ github.ref_name }}'
releaseBody: 'See the assets below for platform-specific downloads.'
releaseDraft: ${{ github.event.inputs.draft || 'false' }}
prerelease: false