Repository navigation
224 lines (217 loc) · 8.24 KB
/
Copy pathdesktop.yml
File metadata and controls
224 lines (217 loc) · 8.24 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
name: Desktop installers
on:
push:
branches: [main, master]
tags: ['v*']
pull_request:
workflow_dispatch:
inputs:
candidate_run_id:
description: Existing successful build run to verify without rebuilding installers
required: false
type: string
candidate_target:
description: Disposable runner to verify; omit to verify every platform
required: false
default: all
type: choice
options: [all, macos-latest, macos-15-intel, windows-latest, ubuntu-latest]
permissions:
contents: read
concurrency:
group: desktop-${{ github.workflow }}-${{ github.ref }}-${{ inputs.candidate_target || 'all' }}
cancel-in-progress: true
jobs:
check:
name: Check and test
if: ${{ !inputs.candidate_run_id }}
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24'
cache: npm
- run: npm ci
- name: Validate release version
if: startsWith(github.ref, 'refs/tags/v')
run: node -e 'if (process.env.GITHUB_REF_NAME !== "v" + require("./package.json").version) throw new Error("Tag must match package.json version")'
- run: npm run typecheck
- run: npm test
- run: npm run build
- name: Install desktop test system libraries
run: npx --no-install playwright install-deps chromium
- name: Prepare virtual audio for desktop voice tests
run: |
sudo apt-get install -y pulseaudio dbus-x11 gnome-keyring
pulseaudio --start --exit-idle-time=-1
pactl load-module module-null-sink sink_name=xiaowang_ci
pactl set-default-sink xiaowang_ci
pactl set-default-source xiaowang_ci.monitor
- name: Exercise the desktop app with local model fixtures
timeout-minutes: 5
run: |
dbus-run-session -- xvfb-run --auto-servernum bash -euc '
export XDG_CURRENT_DESKTOP=GNOME
printf "%s" "xiaowang-ci" | gnome-keyring-daemon --unlock --components=secrets
node --test --test-reporter=tap --test-concurrency=1 --test-timeout=60000 e2e/*.test.mjs
'
- name: Exercise native focus and clipboard on a dedicated virtual desktop
timeout-minutes: 5
run: |
dbus-run-session -- xvfb-run --auto-servernum bash -euc '
export XDG_CURRENT_DESKTOP=GNOME
printf "%s" "xiaowang-ci" | gnome-keyring-daemon --unlock --components=secrets
node --test --test-reporter=tap --test-concurrency=1 --test-timeout=180000 e2e/native/*.test.mjs
'
package:
name: Package ${{ matrix.name }}
needs: check
if: github.event_name != 'pull_request'
strategy:
fail-fast: false
matrix:
include:
- name: macOS
os: macos-latest
arguments: --mac --x64 --arm64
- name: Windows
os: windows-latest
arguments: --win --x64
- name: Linux
os: ubuntu-latest
arguments: --linux --x64
runs-on: ${{ matrix.os }}
timeout-minutes: 45
env:
CSC_LINK: ${{ matrix.name == 'macOS' && secrets.MAC_CSC_LINK || '' }}
CSC_KEY_PASSWORD: ${{ matrix.name == 'macOS' && secrets.MAC_CSC_KEY_PASSWORD || '' }}
WIN_CSC_LINK: ${{ matrix.name == 'Windows' && secrets.WIN_CSC_LINK || '' }}
WIN_CSC_KEY_PASSWORD: ${{ matrix.name == 'Windows' && secrets.WIN_CSC_KEY_PASSWORD || '' }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24'
cache: npm
- run: npm ci
- run: npm run build
- name: Build installers
shell: bash
run: |
if [ -z "${CSC_LINK:-}" ]; then unset CSC_LINK; fi
if [ -z "${WIN_CSC_LINK:-}" ]; then unset WIN_CSC_LINK; fi
npx --no-install electron-builder ${{ matrix.arguments }} --publish never
- name: Verify macOS signatures and first launch from ZIP and DMG
if: matrix.name == 'macOS'
env:
XIAOWANG_MAC_RELEASE_DIR: release
run: node --test --test-concurrency=1 --test-timeout=180000 e2e/native/mac-release.test.mjs
- name: Write SHA-256 checksums
run: node desktop/scripts/checksums.mjs
- name: Upload installers
uses: actions/upload-artifact@v7
with:
name: XiaoWang-${{ matrix.name }}-${{ github.sha }}
retention-days: 14
if-no-files-found: error
path: |
release/*.dmg
release/*.zip
release/*.exe
release/*.AppImage
release/*.deb
release/*.blockmap
release/latest*.yml
release/SHA256SUMS.txt
candidate-acceptance:
name: Accept candidate ${{ matrix.os }}
if: ${{ github.event_name == 'workflow_dispatch' && inputs.candidate_run_id != '' }}
permissions:
contents: read
actions: read
strategy:
fail-fast: false
matrix:
os: ${{ fromJSON(inputs.candidate_target != 'all' && inputs.candidate_target != '' && format('["{0}"]', inputs.candidate_target) || '["macos-latest","macos-15-intel","windows-latest","ubuntu-latest"]') }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24'
cache: npm
- run: npm ci
- uses: actions/download-artifact@v8
with:
github-token: ${{ github.token }}
run-id: ${{ inputs.candidate_run_id }}
pattern: XiaoWang-${{ startsWith(matrix.os, 'macos') && 'macOS' || startsWith(matrix.os, 'windows') && 'Windows' || 'Linux' }}-*
merge-multiple: true
path: candidate
- name: Download original previous release
env:
GH_TOKEN: ${{ github.token }}
run: node scripts/download-previous-installers.mjs
- name: Prepare isolated Linux desktop
if: runner.os == 'Linux'
run: |
npx --no-install playwright install-deps chromium
sudo apt-get install -y dbus-x11 gnome-keyring
- name: Verify actual installation, update and retained data
timeout-minutes: 12
shell: bash
env:
XIAOWANG_CANDIDATE_DIR: candidate
XIAOWANG_PREVIOUS_DIR: previous
XIAOWANG_QA_REPORT_DIR: qa-report
run: |
if [ "$RUNNER_OS" = "Linux" ]; then
dbus-run-session -- xvfb-run --auto-servernum bash -euc '
export XDG_CURRENT_DESKTOP=GNOME
printf "%s" "xiaowang-ci" | gnome-keyring-daemon --unlock --components=secrets
node scripts/verify-candidate-install.mjs
'
else
node scripts/verify-candidate-install.mjs
fi
- name: Retain acceptance reports
if: always()
uses: actions/upload-artifact@v7
with:
name: Candidate-acceptance-${{ matrix.os }}-${{ github.run_id }}
path: qa-report/
retention-days: 14
release:
name: Publish complete GitHub Release
needs: package
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: '24'
- uses: actions/download-artifact@v8
with:
pattern: XiaoWang-*
path: release-publish
merge-multiple: true
- name: Recompute checksums for all platforms
run: node desktop/scripts/checksums.mjs release-publish
- name: Publish installers and update manifests together
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
gh release view "$RELEASE_TAG" >/dev/null 2>&1 || gh release create "$RELEASE_TAG" --draft --verify-tag --generate-notes
gh release upload "$RELEASE_TAG" release-publish/* --clobber
node desktop/scripts/release-notes.ts "$RELEASE_TAG"
gh release edit "$RELEASE_TAG" --draft=false --latest