Skip to content

Commit c3bea6a

Browse files
SonAIengineclaude
andcommitted
ci: 크로스 플랫폼 빌드 + 자동 릴리즈 workflow — Linux/Windows/macOS
- tag push(v*) 시 3개 OS 동시 빌드 (Linux deb/rpm/AppImage, Windows msi/nsis, macOS dmg) - graph-tool-call v0.18.0 sidecar PyInstaller 빌드 포함 - release job: 빌드 완료 후 GitHub Release에 전체 아티팩트 자동 업로드 - workflow_dispatch로 수동 실행도 가능 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b78b081 commit c3bea6a

1 file changed

Lines changed: 107 additions & 82 deletions

File tree

Lines changed: 107 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
name: Build Desktop App
1+
name: Build & Release Desktop App
22

33
on:
44
push:
5-
branches: [main]
6-
pull_request:
7-
branches: [main]
5+
tags: ['v*']
86
workflow_dispatch:
97

108
env:
@@ -13,71 +11,108 @@ env:
1311
TAURI_ENV: "true"
1412
NEXT_PUBLIC_BACKEND_HOST: "https://xgen.x2bee.com"
1513
NEXT_PUBLIC_BACKEND_PORT: ""
16-
GRAPH_TOOL_CALL_VERSION: "0.13.1"
14+
GRAPH_TOOL_CALL_VERSION: "0.18.0"
1715

1816
jobs:
19-
build-windows:
20-
runs-on: windows-latest
17+
build-linux:
18+
runs-on: ubuntu-22.04
2119
timeout-minutes: 90
2220

2321
steps:
2422
- name: Checkout
2523
uses: actions/checkout@v4
2624

27-
# --- PyInstaller: graph-tool-call sidecar ---
25+
- name: Install Linux dependencies
26+
run: |
27+
sudo apt-get update
28+
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
29+
2830
- name: Setup Python
2931
uses: actions/setup-python@v5
3032
with:
3133
python-version: '3.12'
3234

33-
- name: Build graph-tool-call sidecar (Windows)
34-
shell: bash
35+
- name: Build graph-tool-call sidecar (Linux)
3536
run: |
3637
pip install "graph-tool-call[mcp]==$GRAPH_TOOL_CALL_VERSION" pyinstaller
37-
# Find the entry point
3838
ENTRY=$(python -c "import graph_tool_call.__main__; print(graph_tool_call.__main__.__file__)")
39-
echo "Entry point: $ENTRY"
4039
pyinstaller --onefile --name graph-tool-call --hidden-import graph_tool_call "$ENTRY"
41-
# Copy to Tauri sidecar directory with target triple suffix
4240
mkdir -p src-tauri/binaries
43-
cp dist/graph-tool-call.exe "src-tauri/binaries/graph-tool-call-x86_64-pc-windows-msvc.exe"
44-
echo "Sidecar built: $(ls -lh src-tauri/binaries/)"
41+
cp dist/graph-tool-call "src-tauri/binaries/graph-tool-call-x86_64-unknown-linux-gnu"
42+
chmod +x "src-tauri/binaries/graph-tool-call-x86_64-unknown-linux-gnu"
4543
46-
# --- Frontend: xgen-frontend clone & build ---
4744
- name: Setup Node.js
4845
uses: actions/setup-node@v4
4946
with:
5047
node-version: '20'
51-
cache: 'npm'
52-
cache-dependency-path: frontend/package-lock.json
53-
continue-on-error: true
5448

55-
- name: Clone xgen-frontend
49+
- name: Clone & build frontend
5650
run: |
5751
git clone --depth 1 --branch main "https://sonsj97:${{ secrets.GITLAB_TOKEN }}@gitlab.x2bee.com/xgen2.0/xgen-frontend.git" frontend
52+
bash scripts/patch-frontend.sh
53+
cd frontend && npm install && npm run build && cd ..
54+
cp src-cli/cli.html frontend/out/cli.html
5855
59-
- name: Patch frontend for Tauri static export
60-
shell: bash
61-
run: bash scripts/patch-frontend.sh
56+
- name: Setup Rust
57+
uses: dtolnay/rust-toolchain@stable
58+
59+
- name: Rust cache
60+
uses: swatinem/rust-cache@v2
61+
with:
62+
workspaces: src-tauri
63+
cache-on-failure: true
6264

63-
- name: Install frontend dependencies
64-
working-directory: frontend
65-
run: npm install
65+
- name: Install Tauri CLI
66+
run: cargo install tauri-cli --version "^2"
67+
68+
- name: Build Tauri app (Linux)
69+
working-directory: src-tauri
70+
run: cargo tauri build
71+
72+
- name: Upload Linux artifacts
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: xgen-linux
76+
path: |
77+
src-tauri/target/release/bundle/deb/*.deb
78+
src-tauri/target/release/bundle/rpm/*.rpm
79+
src-tauri/target/release/bundle/appimage/*.AppImage
80+
81+
build-windows:
82+
runs-on: windows-latest
83+
timeout-minutes: 90
84+
85+
steps:
86+
- name: Checkout
87+
uses: actions/checkout@v4
6688

67-
- name: Build frontend (static export)
68-
working-directory: frontend
69-
run: npm run build
89+
- name: Setup Python
90+
uses: actions/setup-python@v5
91+
with:
92+
python-version: '3.12'
7093

71-
- name: Copy CLI window HTML
94+
- name: Build graph-tool-call sidecar (Windows)
7295
shell: bash
73-
run: cp src-cli/cli.html frontend/out/cli.html
96+
run: |
97+
pip install "graph-tool-call[mcp]==$GRAPH_TOOL_CALL_VERSION" pyinstaller
98+
ENTRY=$(python -c "import graph_tool_call.__main__; print(graph_tool_call.__main__.__file__)")
99+
pyinstaller --onefile --name graph-tool-call --hidden-import graph_tool_call "$ENTRY"
100+
mkdir -p src-tauri/binaries
101+
cp dist/graph-tool-call.exe "src-tauri/binaries/graph-tool-call-x86_64-pc-windows-msvc.exe"
102+
103+
- name: Setup Node.js
104+
uses: actions/setup-node@v4
105+
with:
106+
node-version: '20'
74107

75-
- name: Verify frontend build output
108+
- name: Clone & build frontend
109+
shell: bash
76110
run: |
77-
if (!(Test-Path "frontend/out")) { Write-Error "frontend/out not found"; exit 1 }
78-
Write-Host "Frontend build OK: $(Get-ChildItem -Recurse frontend/out -File | Measure-Object | Select-Object -ExpandProperty Count) files"
111+
git clone --depth 1 --branch main "https://sonsj97:${{ secrets.GITLAB_TOKEN }}@gitlab.x2bee.com/xgen2.0/xgen-frontend.git" frontend
112+
bash scripts/patch-frontend.sh
113+
cd frontend && npm install && npm run build && cd ..
114+
cp src-cli/cli.html frontend/out/cli.html
79115
80-
# --- Tauri: Rust build ---
81116
- name: Setup Rust
82117
uses: dtolnay/rust-toolchain@stable
83118

@@ -94,19 +129,13 @@ jobs:
94129
working-directory: src-tauri
95130
run: cargo tauri build
96131

97-
- name: Upload MSI installer
98-
uses: actions/upload-artifact@v4
99-
with:
100-
name: xgen-windows-msi
101-
path: src-tauri/target/release/bundle/msi/*.msi
102-
if-no-files-found: warn
103-
104-
- name: Upload NSIS installer
132+
- name: Upload Windows artifacts
105133
uses: actions/upload-artifact@v4
106134
with:
107-
name: xgen-windows-nsis
108-
path: src-tauri/target/release/bundle/nsis/*.exe
109-
if-no-files-found: warn
135+
name: xgen-windows
136+
path: |
137+
src-tauri/target/release/bundle/msi/*.msi
138+
src-tauri/target/release/bundle/nsis/*.exe
110139
111140
build-macos:
112141
runs-on: macos-latest
@@ -116,7 +145,6 @@ jobs:
116145
- name: Checkout
117146
uses: actions/checkout@v4
118147

119-
# --- PyInstaller: graph-tool-call sidecar ---
120148
- name: Setup Python
121149
uses: actions/setup-python@v5
122150
with:
@@ -125,46 +153,24 @@ jobs:
125153
- name: Build graph-tool-call sidecar (macOS)
126154
run: |
127155
pip install "graph-tool-call[mcp]==$GRAPH_TOOL_CALL_VERSION" pyinstaller
128-
# Find the entry point
129156
ENTRY=$(python -c "import graph_tool_call.__main__; print(graph_tool_call.__main__.__file__)")
130-
echo "Entry point: $ENTRY"
131157
pyinstaller --onefile --name graph-tool-call --hidden-import graph_tool_call "$ENTRY"
132-
# Copy to Tauri sidecar directory with target triple suffix
133158
mkdir -p src-tauri/binaries
134159
cp dist/graph-tool-call "src-tauri/binaries/graph-tool-call-aarch64-apple-darwin"
135160
chmod +x "src-tauri/binaries/graph-tool-call-aarch64-apple-darwin"
136-
echo "Sidecar built: $(ls -lh src-tauri/binaries/)"
137161
138-
# --- Frontend ---
139162
- name: Setup Node.js
140163
uses: actions/setup-node@v4
141164
with:
142165
node-version: '20'
143166

144-
- name: Clone xgen-frontend
167+
- name: Clone & build frontend
145168
run: |
146169
git clone --depth 1 --branch main "https://sonsj97:${{ secrets.GITLAB_TOKEN }}@gitlab.x2bee.com/xgen2.0/xgen-frontend.git" frontend
170+
bash scripts/patch-frontend.sh
171+
cd frontend && npm install && npm run build && cd ..
172+
cp src-cli/cli.html frontend/out/cli.html
147173
148-
- name: Patch frontend for Tauri static export
149-
run: bash scripts/patch-frontend.sh
150-
151-
- name: Install frontend dependencies
152-
working-directory: frontend
153-
run: npm install
154-
155-
- name: Build frontend (static export)
156-
working-directory: frontend
157-
run: npm run build
158-
159-
- name: Copy CLI window HTML
160-
run: cp src-cli/cli.html frontend/out/cli.html
161-
162-
- name: Verify frontend build output
163-
run: |
164-
test -d frontend/out || (echo "frontend/out not found" && exit 1)
165-
echo "Frontend build OK: $(find frontend/out -type f | wc -l) files"
166-
167-
# --- Tauri ---
168174
- name: Setup Rust
169175
uses: dtolnay/rust-toolchain@stable
170176

@@ -181,16 +187,35 @@ jobs:
181187
working-directory: src-tauri
182188
run: cargo tauri build
183189

184-
- name: Upload DMG
190+
- name: Upload macOS artifacts
185191
uses: actions/upload-artifact@v4
186192
with:
187-
name: xgen-macos-dmg
188-
path: src-tauri/target/release/bundle/dmg/*.dmg
189-
if-no-files-found: warn
193+
name: xgen-macos
194+
path: |
195+
src-tauri/target/release/bundle/dmg/*.dmg
196+
src-tauri/target/release/bundle/macos/*.app
197+
198+
release:
199+
needs: [build-linux, build-windows, build-macos]
200+
runs-on: ubuntu-latest
201+
if: startsWith(github.ref, 'refs/tags/v')
202+
permissions:
203+
contents: write
190204

191-
- name: Upload macOS app
192-
uses: actions/upload-artifact@v4
205+
steps:
206+
- name: Download all artifacts
207+
uses: actions/download-artifact@v4
208+
with:
209+
path: artifacts
210+
211+
- name: List artifacts
212+
run: find artifacts -type f | head -30
213+
214+
- name: Create GitHub Release
215+
uses: softprops/action-gh-release@v2
193216
with:
194-
name: xgen-macos-app
195-
path: src-tauri/target/release/bundle/macos/*.app
196-
if-no-files-found: warn
217+
generate_release_notes: true
218+
files: |
219+
artifacts/xgen-linux/**/*
220+
artifacts/xgen-windows/**/*
221+
artifacts/xgen-macos/**/*

0 commit comments

Comments
 (0)