1+ name : Build Standalone CLI Executables
2+
3+ on :
4+ push :
5+ branches : [main, develop]
6+ paths :
7+ - ' src/**'
8+ - ' scripts/build-standalone.sh'
9+ - ' .github/workflows/build-standalone-cli.yml'
10+ pull_request :
11+ branches : [main, develop]
12+ paths :
13+ - ' src/**'
14+ - ' scripts/build-standalone.sh'
15+ - ' .github/workflows/build-standalone-cli.yml'
16+ release :
17+ types : [published]
18+ workflow_dispatch :
19+ inputs :
20+ platforms :
21+ description : ' Platforms to build (all, macos, windows, linux)'
22+ required : false
23+ default : ' all'
24+
25+ jobs :
26+ build-standalone :
27+ name : Build Standalone CLI
28+ strategy :
29+ matrix :
30+ os : [ubuntu-latest, macos-latest, windows-latest]
31+ include :
32+ - os : ubuntu-latest
33+ platform : linux
34+ - os : macos-latest
35+ platform : macos
36+ - os : windows-latest
37+ platform : windows
38+
39+ runs-on : ${{ matrix.os }}
40+
41+ steps :
42+ - name : Checkout code
43+ uses : actions/checkout@v4
44+ with :
45+ fetch-depth : 0
46+
47+ - name : Setup Node.js
48+ uses : actions/setup-node@v4
49+ with :
50+ node-version : ' 20.19.2'
51+ cache : ' npm'
52+ cache-dependency-path : ' src/package-lock.json'
53+
54+ - name : Install pnpm
55+ uses : pnpm/action-setup@v4
56+ with :
57+ version : 10.8.1
58+ run_install : false
59+
60+ - name : Get pnpm store directory
61+ shell : bash
62+ run : |
63+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
64+
65+ - name : Setup pnpm cache
66+ uses : actions/cache@v4
67+ with :
68+ path : ${{ env.STORE_PATH }}
69+ key : ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
70+ restore-keys : |
71+ ${{ runner.os }}-pnpm-store-
72+
73+ - name : Install dependencies
74+ run : |
75+ cd src
76+ pnpm install --frozen-lockfile
77+
78+ - name : Build CLI bundle
79+ run : |
80+ cd src
81+ pnpm run build:cli
82+
83+ - name : Install PKG globally (Windows)
84+ if : matrix.os == 'windows-latest'
85+ run : npm install -g pkg
86+
87+ - name : Build standalone executable (Linux)
88+ if : matrix.os == 'ubuntu-latest'
89+ run : |
90+ cd src
91+ pnpm run build:standalone:linux
92+
93+ - name : Build standalone executable (macOS)
94+ if : matrix.os == 'macos-latest'
95+ run : |
96+ cd src
97+ pnpm run build:standalone:macos
98+
99+ - name : Build standalone executable (Windows)
100+ if : matrix.os == 'windows-latest'
101+ run : |
102+ cd src
103+ pnpm run build:standalone:windows
104+
105+ - name : Sign executable (macOS)
106+ if : matrix.os == 'macos-latest'
107+ env :
108+ APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
109+ APPLE_CERTIFICATE_BASE64 : ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
110+ APPLE_CERTIFICATE_PASSWORD : ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
111+ run : |
112+ cd src
113+ pnpm run sign:macos
114+
115+ - name : Sign executable (Windows)
116+ if : matrix.os == 'windows-latest'
117+ env :
118+ WINDOWS_CERTIFICATE_BASE64 : ${{ secrets.WINDOWS_CERTIFICATE_BASE64 }}
119+ WINDOWS_CERTIFICATE_PASSWORD : ${{ secrets.WINDOWS_CERTIFICATE_PASSWORD }}
120+ TIMESTAMP_SERVER : ${{ secrets.TIMESTAMP_SERVER || 'http://timestamp.sectigo.com' }}
121+ run : |
122+ cd src
123+ pnpm run sign:windows
124+
125+ - name : Sign executable (Linux)
126+ if : matrix.os == 'ubuntu-latest'
127+ run : |
128+ cd src
129+ pnpm run sign:linux
130+
131+ - name : Test executable (Linux)
132+ if : matrix.os == 'ubuntu-latest'
133+ run : |
134+ ls -la apps/
135+ ./apps/roo-cline-linux --version || true
136+ ./apps/roo-cline-linux --help || true
137+
138+ - name : Test executable (macOS)
139+ if : matrix.os == 'macos-latest'
140+ run : |
141+ ls -la apps/
142+ ./apps/roo-cline-macos --version || true
143+ ./apps/roo-cline-macos --help || true
144+
145+ - name : Test executable (Windows)
146+ if : matrix.os == 'windows-latest'
147+ run : |
148+ dir apps\
149+ .\apps\roo-cline-win.exe --version
150+ .\apps\roo-cline-win.exe --help
151+
152+ - name : Upload Linux artifacts
153+ if : matrix.os == 'ubuntu-latest'
154+ uses : actions/upload-artifact@v4
155+ with :
156+ name : roo-cli-linux
157+ path : |
158+ apps/roo-cline-linux*
159+ retention-days : 30
160+
161+ - name : Upload macOS artifacts
162+ if : matrix.os == 'macos-latest'
163+ uses : actions/upload-artifact@v4
164+ with :
165+ name : roo-cli-macos
166+ path : |
167+ apps/roo-cline-macos*
168+ retention-days : 30
169+
170+ - name : Upload Windows artifacts
171+ if : matrix.os == 'windows-latest'
172+ uses : actions/upload-artifact@v4
173+ with :
174+ name : roo-cli-windows
175+ path : |
176+ apps/roo-cline-win.exe
177+ retention-days : 30
178+
179+ smoke-test :
180+ name : Smoke Test Executables
181+ needs : build-standalone
182+ strategy :
183+ matrix :
184+ os : [ubuntu-latest, macos-latest, windows-latest]
185+ include :
186+ - os : ubuntu-latest
187+ artifact : roo-cli-linux
188+ executable : roo-cline-linux
189+ - os : macos-latest
190+ artifact : roo-cli-macos
191+ executable : roo-cline-macos
192+ - os : windows-latest
193+ artifact : roo-cli-windows
194+ executable : roo-cline-win.exe
195+
196+ runs-on : ${{ matrix.os }}
197+
198+ steps :
199+ - name : Download artifacts
200+ uses : actions/download-artifact@v4
201+ with :
202+ name : ${{ matrix.artifact }}
203+ path : ./bin
204+
205+ - name : Make executable (Unix)
206+ if : matrix.os != 'windows-latest'
207+ run : chmod +x ./bin/${{ matrix.executable }}
208+
209+ - name : Test basic functionality (Unix)
210+ if : matrix.os != 'windows-latest'
211+ run : |
212+ ./bin/${{ matrix.executable }} --version
213+ ./bin/${{ matrix.executable }} --help
214+ ./bin/${{ matrix.executable }} --generate-config ./test-config.json
215+ cat ./test-config.json
216+
217+ - name : Test basic functionality (Windows)
218+ if : matrix.os == 'windows-latest'
219+ run : |
220+ .\bin\${{ matrix.executable }} --version
221+ .\bin\${{ matrix.executable }} --help
222+ .\bin\${{ matrix.executable }} --generate-config .\test-config.json
223+ type .\test-config.json
224+
225+ # Only run on releases or manual dispatch
226+ release-artifacts :
227+ name : Release Artifacts
228+ if : github.event_name == 'release' || github.event_name == 'workflow_dispatch'
229+ needs : [build-standalone, smoke-test]
230+ runs-on : ubuntu-latest
231+
232+ steps :
233+ - name : Download all artifacts
234+ uses : actions/download-artifact@v4
235+ with :
236+ path : ./artifacts
237+
238+ - name : Display structure
239+ run : ls -la artifacts/
240+
241+ - name : Combine artifacts
242+ run : |
243+ mkdir -p release
244+ cp artifacts/roo-cli-linux/* release/
245+ cp artifacts/roo-cli-macos/* release/
246+ cp artifacts/roo-cli-windows/* release/
247+
248+ - name : Upload combined artifacts
249+ uses : actions/upload-artifact@v4
250+ with :
251+ name : roo-cli-all-platforms
252+ path : release/
253+ retention-days : 90
254+
255+ - name : Upload to release (if release event)
256+ if : github.event_name == 'release'
257+ uses : softprops/action-gh-release@v1
258+ with :
259+ files : release/*
260+ env :
261+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments