Repository navigation
388 lines (385 loc) · 21.1 KB
/
Copy pathwindows.yml
File metadata and controls
388 lines (385 loc) · 21.1 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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
name: Windows native validation
on:
workflow_call:
inputs:
signed_updates:
type: boolean
default: false
gui_package_run:
type: string
default: ''
gui_auth_public_key:
type: string
default: ''
secrets:
TAURI_SIGNING_PRIVATE_KEY:
required: false
TAURI_SIGNING_PRIVATE_KEY_PASSWORD:
required: false
workflow_dispatch:
inputs:
signed_updates:
description: Sign updater payloads for a release candidate
type: boolean
default: false
gui_package_run:
description: Reuse an existing SDK-verified candidate for GUI-only acceptance
type: string
default: ''
gui_auth_public_key:
description: Optional base64 RSA public key for one real GUI device sign-in
type: string
default: ''
pull_request:
paths: ['scripts/**', 'tauri/**', 'extension/**', '.github/workflows/windows.yml']
concurrency:
group: windows-native-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
actions: read
jobs:
installer-scripts:
if: "!inputs.gui_package_run"
runs-on: windows-2025
timeout-minutes: 5
strategy:
matrix:
shell: [powershell, pwsh]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- name: Verify checksum manifests in Windows PowerShell 5.1
if: matrix.shell == 'powershell'
shell: powershell
run: ./tauri/scripts/windows-installer-regressions.ps1
- name: Verify checksum manifests in PowerShell 7
if: matrix.shell == 'pwsh'
shell: pwsh
run: ./tauri/scripts/windows-installer-regressions.ps1
windows:
if: "!inputs.gui_package_run"
runs-on: windows-2025
timeout-minutes: 50
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
workspaces: tauri/src-tauri
cache-on-failure: true
- run: npm ci
working-directory: tauri
- run: npm run build:desktop
working-directory: tauri
- run: cargo fmt --manifest-path tauri/src-tauri/Cargo.toml -- --check
- name: Verify two isolated T3 desktop instances
run: python tauri/scripts/t3-native-smoke.py
- run: cargo test --locked --manifest-path tauri/src-tauri/Cargo.toml
- run: npm test
working-directory: tauri
- run: npm ci
working-directory: extension
- run: npm run build:helper
working-directory: extension
- name: Install official VS Code and Codex extension in disposable directories
shell: pwsh
run: |
$codeRoot = Join-Path $env:RUNNER_TEMP 'vscode'
Invoke-WebRequest 'https://update.code.visualstudio.com/1.140.0/win32-x64-archive/stable' -OutFile "$env:RUNNER_TEMP/vscode.zip"
Expand-Archive "$env:RUNNER_TEMP/vscode.zip" $codeRoot
$extensions = Join-Path $env:RUNNER_TEMP 'codex-extensions'
for ($attempt = 1; $attempt -le 3; $attempt++) {
& "$codeRoot/bin/code.cmd" --user-data-dir "$env:RUNNER_TEMP/install-profile" --extensions-dir $extensions --install-extension openai.chatgpt@26.1002.51308 --force
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -eq 3) { throw 'Official extension installation failed after three attempts' }
Start-Sleep -Seconds 5
}
$official = (Get-ChildItem $extensions -Directory -Filter 'openai.chatgpt-*' | Select-Object -First 1).FullName
if (!$official) { throw 'Official extension missing' }
"MULTI_CODEX_TEST_VSCODE=$codeRoot/Code.exe" >> $env:GITHUB_ENV
"MULTI_CODEX_TEST_EXTENSION=$official" >> $env:GITHUB_ENV
"MULTI_CODEX_TEST_ENGINE=$official/bin/windows-x86_64/codex.exe" >> $env:GITHUB_ENV
- name: Verify two native VS Code accounts and isolated PowerShell CLI
run: cargo test --locked --manifest-path tauri/src-tauri/Cargo.toml windows_live_launches -- --ignored --test-threads=1
- name: Install the official signed Codex Windows MSIX in the disposable runner
shell: pwsh
run: |
$package = "$env:RUNNER_TEMP/Codex.msix"
Invoke-WebRequest 'https://persistent.oaistatic.com/codex-app-prod/ChatGPT-x64.msix' -OutFile $package
Add-AppxPackage -Path $package
$location = (Get-AppxPackage -Name OpenAI.Codex).InstallLocation
if (!$location) { throw 'The signed OpenAI.Codex package is missing' }
"MULTI_CODEX_TEST_STANDALONE=$location/app/ChatGPT.exe" >> $env:GITHUB_ENV
- name: Verify installed standalone isolation with disposable accounts
run: cargo test --locked --manifest-path tauri/src-tauri/Cargo.toml windows_live_standalone -- --ignored --test-threads=1
- run: npm test
working-directory: extension
- name: Package Windows VSIX and extract the exact package for UI tests
working-directory: extension
shell: pwsh
run: |
npm run package:platform -- win32-x64
if ($LASTEXITCODE -ne 0) { throw 'VSIX packaging failed' }
$manifest = Get-Content package.json | ConvertFrom-Json
$vsix = "$($manifest.name)-win32-x64-$($manifest.version).vsix"
Copy-Item $vsix "$env:RUNNER_TEMP/extension.zip"
Expand-Archive "$env:RUNNER_TEMP/extension.zip" "$env:RUNNER_TEMP/packaged-extension"
"MULTI_CODEX_TEST_DEVELOPMENT_PATH=$env:RUNNER_TEMP/packaged-extension/extension" >> $env:GITHUB_ENV
- name: Verify packaged live attachment in real Windows VS Code
working-directory: extension
shell: pwsh
run: |
$env:MULTI_CODEX_TEST_LIVE_ATTACH='1'
node scripts/test-vscode.mjs
if ($LASTEXITCODE -ne 0) { throw 'Packaged Windows live attachment failed' }
Copy-Item .test-results/vscode-result.json .test-results/packaged-live-attachment.json
- name: Verify packaged native wrapper startup and account restoration
env:
MULTI_CODEX_TEST_ORBIT_UI: '1'
working-directory: extension
shell: pwsh
run: |
node scripts/test-vscode.mjs
if ($LASTEXITCODE -ne 0) { throw 'Packaged Windows startup failed' }
Copy-Item .test-results/vscode-result.json .test-results/packaged-startup.json
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-extension-evidence
path: extension/.test-results/
include-hidden-files: true
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: extension-win32-x64
path: extension/*-win32-x64-*.vsix
- name: Build Windows package and optional signed updater
shell: pwsh
working-directory: tauri
env:
SIGNED_UPDATES: ${{ inputs.signed_updates }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
run: |
if ($env:SIGNED_UPDATES -eq 'true') {
if (!$env:TAURI_SIGNING_PRIVATE_KEY) { throw 'Updater signing key is required for release packages' }
python scripts/github-asset-build.py -- npm run tauri -- build --bundles nsis --config src-tauri/tauri.windows.conf.json --config src-tauri/tauri.updater.conf.json
} else {
python scripts/github-asset-build.py -- npm run tauri -- build --bundles nsis --config src-tauri/tauri.windows.conf.json
}
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Normalize the manifest-derived Windows installer filename
shell: pwsh
run: |
$version = (Get-Content tauri/package.json | ConvertFrom-Json).version
$package = @(Get-ChildItem tauri/src-tauri/target/release/bundle/nsis/*.exe)
if ($package.Count -ne 1) { throw 'Expected one NSIS candidate' }
$destination = Join-Path $package[0].DirectoryName "Multi.Codex_$($version)_x64-setup.exe"
if ($package[0].FullName -ne $destination) {
if (Test-Path "$($package[0].FullName).sig") { Move-Item "$($package[0].FullName).sig" "$destination.sig" }
Move-Item $package[0].FullName $destination
}
"MULTI_CODEX_TEST_INSTALLER=$destination" >> $env:GITHUB_ENV
- name: Install, update and restart the exact packaged Windows app
shell: pwsh
run: ./tauri/scripts/windows-installer-smoke.ps1 -Installer $env:MULTI_CODEX_TEST_INSTALLER
- name: Exercise native SDK update and signed-payload refusal on Windows
if: inputs.signed_updates && !cancelled() && env.MULTI_CODEX_TEST_INSTALLER != ''
shell: pwsh
run: |
cargo build --locked --manifest-path tauri/src-tauri/Cargo.toml --example native-updater
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
python tauri/scripts/native-updater-smoke.py --harness tauri/src-tauri/target/debug/examples/native-updater.exe --payload $env:MULTI_CODEX_TEST_INSTALLER --output "$env:RUNNER_TEMP/native-updater-windows/result.json"
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: native-updater-windows-evidence
path: ${{ runner.temp }}/native-updater-windows/
- name: Install isolated native GUI test driver
if: "!cancelled() && env.MULTI_CODEX_TEST_INSTALLER != ''"
shell: pwsh
run: |
npm install --prefix "$env:RUNNER_TEMP/multi-codex-gui-driver" --no-save --ignore-scripts playwright@1.56.1
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
- name: Observe actual Windows sign-in GUI and terminal windows
if: "!inputs.gui_auth_public_key && !cancelled() && env.MULTI_CODEX_TEST_INSTALLER != ''"
shell: pwsh
run: ./tauri/scripts/windows-gui-signin.ps1 -Binary "$env:GITHUB_WORKSPACE/tauri/src-tauri/target/release/multi-codex-desktop.exe" -Installer $env:MULTI_CODEX_TEST_INSTALLER
- name: Start real GUI authentication with private instructions
if: inputs.gui_auth_public_key && !cancelled() && env.MULTI_CODEX_TEST_INSTALLER != ''
shell: pwsh
env:
GUI_AUTH_PUBLIC_KEY: ${{ inputs.gui_auth_public_key }}
run: |
$arguments = @('-NoProfile','-File',"$env:GITHUB_WORKSPACE/tauri/scripts/windows-gui-signin-background.ps1",'-Binary',"$env:GITHUB_WORKSPACE/tauri/src-tauri/target/release/multi-codex-desktop.exe",'-Installer',$env:MULTI_CODEX_TEST_INSTALLER) | ForEach-Object { '"' + $_ + '"' }
# Keep the long-lived child independent of this step's redirected
# PowerShell pipe readers. Its test-driver console is hidden; native
# application/browser/console windows are observed separately.
$output = "$env:RUNNER_TEMP/multi-codex-gui-signin-evidence"
New-Item -ItemType Directory -Force $output | Out-Null
$started = Start-Process -FilePath (Get-Command pwsh).Source -ArgumentList $arguments -WindowStyle Hidden -PassThru
[ordered]@{ source=$env:GITHUB_SHA; processId=$started.Id } | ConvertTo-Json | Set-Content "$output/background-start.json"
- name: Wait for encrypted real GUI device instructions
id: gui_instructions
if: inputs.gui_auth_public_key && !cancelled() && env.MULTI_CODEX_TEST_INSTALLER != ''
shell: pwsh
run: |
$output = "$env:RUNNER_TEMP/multi-codex-gui-signin-evidence"
$deadline = [DateTime]::UtcNow.AddMinutes(4)
while (!(Test-Path "$output/signin.encrypted")) {
if (Test-Path "$output/exit-status") { throw 'GUI sign-in failed before user instructions; see sanitized result' }
if ([DateTime]::UtcNow -ge $deadline) { throw 'GUI device instructions unavailable' }
Start-Sleep -Seconds 2
}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: inputs.gui_auth_public_key && steps.gui_instructions.outcome == 'success'
with:
name: windows-gui-signin-encrypted
path: ${{ runner.temp }}/multi-codex-gui-signin-evidence/signin.encrypted
retention-days: 1
- name: Verify real GUI authentication and cleanup completion
if: inputs.gui_auth_public_key && steps.gui_instructions.outcome == 'success'
shell: pwsh
run: |
$output = "$env:RUNNER_TEMP/multi-codex-gui-signin-evidence"
$deadline = [DateTime]::UtcNow.AddMinutes(18)
while (!(Test-Path "$output/exit-status")) {
if ([DateTime]::UtcNow -ge $deadline) { throw 'Real GUI completion timed out' }
Start-Sleep -Seconds 2
}
if ((Get-Content "$output/exit-status" -Raw).Trim() -ne '0') { throw 'Real GUI acceptance failed; see sanitized result' }
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-gui-signin-evidence
path: ${{ runner.temp }}/multi-codex-gui-signin-evidence/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-installer-evidence
path: ${{ runner.temp }}/multi-codex-windows-evidence/
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-installer
path: |
tauri/src-tauri/target/release/bundle/nsis/*.exe
tauri/src-tauri/target/release/bundle/nsis/*.exe.sig
gui:
if: inputs.gui_package_run
runs-on: windows-2025
timeout-minutes: 30
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: 24
- name: Reuse the exact SDK-verified candidate
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
PACKAGE_RUN: ${{ inputs.gui_package_run }}
run: |
if ($env:PACKAGE_RUN -notmatch '^\d+$') { throw 'Invalid candidate run' }
$packages = "$env:RUNNER_TEMP/gui-candidate"
$evidence = "$env:RUNNER_TEMP/gui-candidate-evidence"
gh run download $env:PACKAGE_RUN --name windows-installer --dir $packages
if ($LASTEXITCODE -ne 0) { throw 'Candidate download failed' }
gh run download $env:PACKAGE_RUN --name native-updater-windows-evidence --dir $evidence
if ($LASTEXITCODE -ne 0) { throw 'Candidate evidence download failed' }
$report = Get-Content "$evidence/result.json" -Raw | ConvertFrom-Json
if ($report.candidateSource -notmatch '^[0-9a-f]{40}$' -or !$report.passed) { throw 'Invalid candidate evidence' }
# The owned acceptance branch is amended; its previous candidate is
# retained by the completed run, but is no longer a branch ancestor.
git fetch --depth=1 origin $report.candidateSource
if ($LASTEXITCODE -ne 0) { throw 'Candidate source fetch failed' }
git diff --quiet $report.candidateSource HEAD -- cli/crates/core tauri/src tauri/src-tauri/src tauri/src-tauri/Cargo.toml tauri/src-tauri/Cargo.lock tauri/src-tauri/tauri.conf.json extension/src ':(exclude)cli/crates/core/src/profiles_shared_native_tests.rs' ':(exclude)cli/crates/core/src/profiles_windows_tests.rs'
if ($LASTEXITCODE -ne 0) { throw 'Candidate production source differs from this GUI harness source' }
$installer = @(Get-ChildItem $packages -Recurse -Filter '*.exe')
if ($installer.Count -ne 1 -or (Get-FileHash $installer[0].FullName).Hash -ne $report.payloadSha256) { throw 'Candidate payload hash mismatch' }
"MULTI_CODEX_TEST_INSTALLER=$($installer[0].FullName)" >> $env:GITHUB_ENV
"MULTI_CODEX_GUI_CANDIDATE_EVIDENCE=$evidence/result.json" >> $env:GITHUB_ENV
- name: Recheck exact signed installer and complete disposable cleanup
shell: pwsh
run: ./tauri/scripts/windows-installer-smoke.ps1 -Installer $env:MULTI_CODEX_TEST_INSTALLER
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-installer-evidence
path: ${{ runner.temp }}/multi-codex-windows-evidence/
- name: Install pinned editor and engine in disposable directories
shell: pwsh
run: |
$codeRoot = Join-Path $env:RUNNER_TEMP 'vscode'
Invoke-WebRequest 'https://update.code.visualstudio.com/1.140.0/win32-x64-archive/stable' -OutFile "$env:RUNNER_TEMP/vscode.zip"
Expand-Archive "$env:RUNNER_TEMP/vscode.zip" $codeRoot
$extensions = Join-Path $env:RUNNER_TEMP 'codex-extensions'
for ($attempt = 1; $attempt -le 3; $attempt++) {
& "$codeRoot/bin/code.cmd" --user-data-dir "$env:RUNNER_TEMP/install-profile" --extensions-dir $extensions --install-extension openai.chatgpt@26.1002.51308 --force
if ($LASTEXITCODE -eq 0) { break }
if ($attempt -eq 3) { throw 'Official extension installation failed' }
Start-Sleep -Seconds 5
}
$official = (Get-ChildItem $extensions -Directory -Filter 'openai.chatgpt-*' | Select-Object -First 1).FullName
if (!$official) { throw 'Official extension missing' }
"MULTI_CODEX_TEST_VSCODE=$codeRoot/Code.exe" >> $env:GITHUB_ENV
"MULTI_CODEX_TEST_ENGINE=$official/bin/windows-x86_64/codex.exe" >> $env:GITHUB_ENV
npm install --prefix "$env:RUNNER_TEMP/multi-codex-gui-driver" --no-save --ignore-scripts playwright@1.56.1
if ($LASTEXITCODE -ne 0) { throw 'GUI driver installation failed' }
- name: Observe real GUI cancellation and cleanup
if: "!inputs.gui_auth_public_key"
shell: pwsh
run: ./tauri/scripts/windows-gui-signin.ps1 -Installer $env:MULTI_CODEX_TEST_INSTALLER -CandidateEvidence $env:MULTI_CODEX_GUI_CANDIDATE_EVIDENCE
- name: Start real GUI authentication with private instructions
if: inputs.gui_auth_public_key
shell: pwsh
env:
GUI_AUTH_PUBLIC_KEY: ${{ inputs.gui_auth_public_key }}
run: |
$arguments = @('-NoProfile','-File',"$env:GITHUB_WORKSPACE/tauri/scripts/windows-gui-signin-background.ps1",'-Installer',$env:MULTI_CODEX_TEST_INSTALLER,'-CandidateEvidence',$env:MULTI_CODEX_GUI_CANDIDATE_EVIDENCE) | ForEach-Object { '"' + $_ + '"' }
# Keep the long-lived child independent of this step's redirected
# PowerShell pipe readers. Its test-driver console is hidden; native
# application/browser/console windows are observed separately.
$output = "$env:RUNNER_TEMP/multi-codex-gui-signin-evidence"
New-Item -ItemType Directory -Force $output | Out-Null
$started = Start-Process -FilePath (Get-Command pwsh).Source -ArgumentList $arguments -WindowStyle Hidden -PassThru
[ordered]@{ source=$env:GITHUB_SHA; processId=$started.Id } | ConvertTo-Json | Set-Content "$output/background-start.json"
- name: Wait for encrypted real GUI device instructions
id: gui_instructions
if: inputs.gui_auth_public_key
shell: pwsh
run: |
$output = "$env:RUNNER_TEMP/multi-codex-gui-signin-evidence"
$deadline = [DateTime]::UtcNow.AddMinutes(4)
while (!(Test-Path "$output/signin.encrypted")) {
if (Test-Path "$output/exit-status") { throw 'GUI failed before user instructions; see sanitized result' }
if ([DateTime]::UtcNow -ge $deadline) { throw 'GUI instructions unavailable' }
Start-Sleep -Seconds 2
}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: inputs.gui_auth_public_key && steps.gui_instructions.outcome == 'success'
with:
name: windows-gui-signin-encrypted
path: ${{ runner.temp }}/multi-codex-gui-signin-evidence/signin.encrypted
retention-days: 1
- name: Verify real GUI authentication and cleanup completion
if: inputs.gui_auth_public_key && steps.gui_instructions.outcome == 'success'
shell: pwsh
run: |
$output = "$env:RUNNER_TEMP/multi-codex-gui-signin-evidence"
$deadline = [DateTime]::UtcNow.AddMinutes(18)
while (!(Test-Path "$output/exit-status")) {
if ([DateTime]::UtcNow -ge $deadline) { throw 'GUI completion timed out' }
Start-Sleep -Seconds 2
}
if ((Get-Content "$output/exit-status" -Raw).Trim() -ne '0') { throw 'GUI acceptance failed; see sanitized result' }
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-gui-signin-evidence
path: ${{ runner.temp }}/multi-codex-gui-signin-evidence/