-
-
Notifications
You must be signed in to change notification settings - Fork 155
317 lines (280 loc) · 10.5 KB
/
Copy pathinstaller-verify.yml
File metadata and controls
317 lines (280 loc) · 10.5 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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
name: Installer Verify
on:
workflow_dispatch:
inputs:
windows:
description: Build and smoke the Windows Inno Setup installer
type: boolean
default: true
linux:
description: Build and smoke the Linux self-contained tarball
type: boolean
default: true
macos:
description: Build and smoke the unsigned macOS app/pkg
type: boolean
default: true
permissions:
contents: read
concurrency:
group: installer-verify-${{ github.ref }}
cancel-in-progress: false
env:
WINDOWS_PYTHON_VERSION: "3.13.2"
ROW_BOT_STARTUP_TIMEOUT: "180"
jobs:
preflight:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install uv
run: python -m pip install "uv>=0.7,<1.0"
- name: Verify locked dependency files
run: |
uv lock --check
python scripts/export_locked_requirements.py --check
verify-windows:
if: ${{ inputs.windows }}
needs: preflight
runs-on: windows-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: ${{ env.WINDOWS_PYTHON_VERSION }}
- name: Install Inno Setup
run: choco install innosetup --yes --no-progress
- name: Build Windows installer
shell: pwsh
run: .\installer\build_installer.ps1 -PythonVersion "${{ env.WINDOWS_PYTHON_VERSION }}"
- name: Smoke installed Windows package
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
$installer = Get-ChildItem -Path dist -Filter "Row-Bot-*-Windows-*.exe" | Select-Object -First 1
if (-not $installer) {
throw "Windows installer artifact not found under dist"
}
$installDir = Join-Path $env:RUNNER_TEMP "Row-Bot"
$installLog = Join-Path $env:RUNNER_TEMP "row-bot-install.log"
if (Test-Path $installDir) {
Remove-Item -LiteralPath $installDir -Recurse -Force
}
$installerArgs = @(
"/VERYSILENT",
"/SUPPRESSMSGBOXES",
"/NORESTART",
"/DIR=$installDir",
"/LOG=$installLog"
)
$installerProcess = Start-Process `
-FilePath $installer.FullName `
-ArgumentList $installerArgs `
-Wait `
-PassThru `
-WindowStyle Hidden
if ($installerProcess.ExitCode -ne 0) {
Get-Content $installLog -ErrorAction SilentlyContinue
throw "Installer exited with code $($installerProcess.ExitCode)"
}
$pythonExe = Join-Path $installDir "python\python.exe"
$appDir = Join-Path $installDir "app"
foreach ($required in @(
$pythonExe,
(Join-Path $appDir "launcher.py"),
(Join-Path $appDir "scripts\verify_runtime_dependencies.py")
)) {
if (!(Test-Path $required)) {
throw "Expected installed file missing: $required"
}
}
$env:PYTHONNOUSERSITE = "1"
$env:PYTHONIOENCODING = "utf-8"
$env:TCL_LIBRARY = Join-Path $installDir "python\tcl\tcl8.6"
$env:TK_LIBRARY = Join-Path $installDir "python\tcl\tk8.6"
$env:PLAYWRIGHT_BROWSERS_PATH = Join-Path $installDir "python\playwright-browsers"
$env:PATH = (Join-Path $installDir "python\Scripts") + ";" + (Join-Path $installDir "python") + ";" + $env:PATH
& $pythonExe (Join-Path $appDir "scripts\verify_runtime_dependencies.py") all
if ($LASTEXITCODE -ne 0) {
throw "Installed runtime verifier failed with code $LASTEXITCODE"
}
python scripts/smoke_app.py `
--port 8094 `
--timeout 180 `
--cwd "$appDir" `
-- "$pythonExe" launcher.py --server --no-open --no-splash --no-ollama --port 8094
- name: Upload Windows installer
if: always()
uses: actions/upload-artifact@v7
with:
name: Row-Bot-Windows-verified
path: dist/Row-Bot-*-Windows-*.exe
retention-days: 14
- name: Upload Windows install log
if: always()
uses: actions/upload-artifact@v7
with:
name: Row-Bot-Windows-install-log
path: ${{ runner.temp }}\row-bot-install.log
if-no-files-found: ignore
retention-days: 14
verify-linux:
if: ${{ inputs.linux }}
needs: preflight
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install Linux build/runtime libraries
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends rsync binutils libgl1 libegl1 libglib2.0-0 libxcb-cursor0 libportaudio2
- name: Validate Linux installer scripts
run: bash -n build_linux_app.sh installer/build_linux_app.sh installer/install-linux.sh
- name: Build Linux package
run: |
chmod +x installer/build_linux_app.sh
./installer/build_linux_app.sh
- name: Smoke installed Linux package
run: |
set -euo pipefail
mkdir -p "$RUNNER_TEMP/row-bot-linux-smoke"
tar -xzf dist/Row-Bot-*-Linux-*.tar.gz -C "$RUNNER_TEMP/row-bot-linux-smoke"
PACKAGE_ROOT="$(find "$RUNNER_TEMP/row-bot-linux-smoke" -maxdepth 1 -type d -name 'Row-Bot-*-Linux-*' | head -n 1)"
if [ -z "$PACKAGE_ROOT" ]; then
echo "::error::Linux package root not found after extraction"
exit 1
fi
chmod +x "$PACKAGE_ROOT/bin/row-bot"
export HOME="$RUNNER_TEMP/row-bot-linux-home"
export XDG_DATA_HOME="$RUNNER_TEMP/row-bot-linux-xdg"
mkdir -p "$HOME" "$XDG_DATA_HOME"
bash "$PACKAGE_ROOT/install.sh"
python scripts/smoke_app.py \
--port 8095 \
--timeout 180 \
--cwd "$XDG_DATA_HOME/row-bot/current/app" \
-- "$HOME/.local/bin/row-bot" --no-open --port 8095 --no-ollama
python scripts/smoke_app.py \
--port 8096 \
--timeout 120 \
--cwd "$XDG_DATA_HOME/row-bot/current/app" \
-- "$HOME/.local/bin/row-bot" --server --no-open --port 8096 --no-ollama
- name: Upload Linux package
if: always()
uses: actions/upload-artifact@v7
with:
name: Row-Bot-Linux-verified
path: dist/Row-Bot-*-Linux-*.tar.gz
retention-days: 14
verify-macos:
if: ${{ inputs.macos }}
needs: preflight
runs-on: macos-latest
timeout-minutes: 180
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build unsigned macOS package
env:
BUNDLE_PLAYWRIGHT: "0"
run: |
chmod +x installer/build_mac_app.sh
./installer/build_mac_app.sh
- name: Smoke macOS app bundle
run: |
set -euo pipefail
resolve_bundle_python() {
local resources="$1"
local candidate
for candidate in \
"$resources/python/bin/python3" \
"$resources/python/bin/python" \
"$resources/python/bin"/python3.*; do
if [ -x "$candidate" ]; then
printf '%s\n' "$candidate"
return 0
fi
done
return 1
}
APP_PATH="$(pwd)/installer/build/mac/Row-Bot.app"
RESOURCES="$APP_PATH/Contents/Resources"
APP_DIR="$RESOURCES/app"
if ! PYTHON="$(resolve_bundle_python "$RESOURCES")"; then
echo "::error::Bundled Python not found under $RESOURCES/python/bin"
find "$APP_PATH" -maxdepth 5 -path '*/python/bin/*' -print || true
exit 1
fi
ROW_BOT_INSTALL_ROOT="$RESOURCES" \
PYTHONNOUSERSITE=1 \
PYTHONIOENCODING=utf-8 \
PLAYWRIGHT_BROWSERS_PATH="$RESOURCES/python/playwright-browsers" \
python scripts/smoke_app.py \
--port 8097 \
--timeout 180 \
--cwd "$APP_DIR" \
-- "$PYTHON" launcher.py --server --no-open --no-splash --no-ollama --port 8097
- name: Install and smoke macOS package
run: |
set -euo pipefail
PKG="$(find dist -maxdepth 1 -name 'Row-Bot-*-macOS-*.pkg' | head -n 1)"
if [ -z "$PKG" ]; then
echo "::error::macOS pkg artifact not found under dist"
exit 1
fi
sudo rm -rf /Applications/Row-Bot.app
sudo installer -pkg "$PKG" -target /
APP_PATH="/Applications/Row-Bot.app"
RESOURCES="$APP_PATH/Contents/Resources"
APP_DIR="$RESOURCES/app"
resolve_bundle_python() {
local resources="$1"
local candidate
for candidate in \
"$resources/python/bin/python3" \
"$resources/python/bin/python" \
"$resources/python/bin"/python3.*; do
if [ -x "$candidate" ]; then
printf '%s\n' "$candidate"
return 0
fi
done
return 1
}
if ! PYTHON="$(resolve_bundle_python "$RESOURCES")"; then
echo "::group::macOS pkg payload"
pkgutil --payload-files "$PKG" | sed -n '1,160p' || true
echo "::endgroup::"
echo "::group::Installed Row-Bot candidates"
find /Applications -maxdepth 7 \( -name 'Row-Bot.app' -o -path '*/Row-Bot.app/Contents/Resources/python/bin/*' \) -print || true
echo "::endgroup::"
echo "::error::Installed bundled Python not found under $RESOURCES/python/bin"
exit 1
fi
ROW_BOT_INSTALL_ROOT="$RESOURCES" \
PYTHONNOUSERSITE=1 \
PYTHONIOENCODING=utf-8 \
PLAYWRIGHT_BROWSERS_PATH="$RESOURCES/python/playwright-browsers" \
python scripts/smoke_app.py \
--port 8098 \
--timeout 180 \
--cwd "$APP_DIR" \
-- "$PYTHON" launcher.py --server --no-open --no-splash --no-ollama --port 8098
- name: Upload macOS package
if: always()
uses: actions/upload-artifact@v7
with:
name: Row-Bot-macOS-verified
path: dist/Row-Bot-*-macOS-*.pkg
retention-days: 14