@@ -137,19 +137,10 @@ jobs:
137137 repository : ${{ inputs.repository || github.repository }}
138138 ref : ${{ inputs.ref }}
139139 submodules : recursive
140- - uses : actions/setup-python@v6
141- with :
142- python-version : ' 3.11'
143- - name : Use Node.js ${{ env.NODE_VERSION }}
144- uses : actions/setup-node@v6
140+ - uses : ./.github/actions/setup-ci-environment
145141 with :
146142 node-version : ${{ env.NODE_VERSION }}
147- cache : yarn
148- - name : Install and build dependencies
149- run : yarn
150- env :
151- npm_config_arch : ${{ matrix.arch }}
152- TARGET_ARCH : ${{ matrix.arch }}
143+ arch : ${{ matrix.arch }}
153144 - name : Validate macOS version
154145 if : runner.os == 'macOS'
155146 run : yarn validate-macos-version
@@ -189,22 +180,12 @@ jobs:
189180 run : yarn test:unit
190181 - name : Run script tests
191182 run : yarn test:script
192- - name : Install Azure Code Signing Client
193- if : ${{ runner.os == 'Windows' }}
194- run : |
195- $acsZip = Join-Path $env:RUNNER_TEMP "acs.zip"
196- $acsDir = Join-Path $env:RUNNER_TEMP "acs"
197- Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Trusted.Signing.Client/1.0.95 -OutFile $acsZip -Verbose
198- Expand-Archive $acsZip -Destination $acsDir -Force -Verbose
199- # Replace ancient signtool in electron-winstall with one that supports ACS
200- Copy-Item -Path "C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\*" -Include signtool.exe,signtool.exe.manifest,Microsoft.Windows.Build.Signing.mssign32.dll.manifest,mssign32.dll,Microsoft.Windows.Build.Signing.wintrust.dll.manifest,wintrust.dll,Microsoft.Windows.Build.Appx.AppxSip.dll.manifest,AppxSip.dll,Microsoft.Windows.Build.Appx.AppxPackaging.dll.manifest,AppxPackaging.dll,Microsoft.Windows.Build.Appx.OpcServices.dll.manifest,OpcServices.dll -Destination "node_modules\electron-winstaller\vendor" -Verbose
201- - name : Azure Login (OIDC)
202- if : ${{ runner.os == 'Windows' && inputs.sign }}
203- uses : azure/login@v2
183+ - if : runner.os == 'Windows'
184+ uses : ./.github/actions/setup-windows-signing
204185 with :
205- client-id : ${{ secrets.AZURE_CODE_SIGNING_CLIENT_ID }}
206- tenant- id : ${{ secrets.AZURE_CODE_SIGNING_TENANT_ID }}
207- allow-no-subscriptions : true
186+ enabled : ${{ inputs.sign }}
187+ azure-client- id : ${{ secrets.AZURE_CODE_SIGNING_CLIENT_ID }}
188+ azure-tenant-id : ${{ secrets.AZURE_CODE_SIGNING_TENANT_ID }}
208189 - name : Package production app
209190 run : yarn package
210191 env :
@@ -233,6 +214,137 @@ jobs:
233214 dist/bundle-size.json
234215 if-no-files-found : error
235216
217+ e2e-smoke :
218+ name : E2E Smoke ${{ matrix.friendlyName }} ${{ matrix.arch }}
219+ runs-on : ${{ matrix.os }}
220+ permissions :
221+ contents : read
222+ id-token : write
223+ strategy :
224+ fail-fast : false
225+ matrix :
226+ include :
227+ - os : macos-14
228+ friendlyName : macOS
229+ arch : arm64
230+ - os : windows-2022
231+ friendlyName : Windows
232+ arch : x64
233+ timeout-minutes : 60
234+ environment : ${{ inputs.environment }}
235+ env :
236+ RELEASE_CHANNEL : ${{ inputs.environment }}
237+ steps :
238+ - uses : actions/checkout@v4
239+ with :
240+ repository : ${{ inputs.repository || github.repository }}
241+ ref : ${{ inputs.ref }}
242+ submodules : recursive
243+ - uses : ./.github/actions/setup-ci-environment
244+ with :
245+ node-version : ${{ env.NODE_VERSION }}
246+ arch : ${{ matrix.arch }}
247+ install-ffmpeg : ' true'
248+ - name : Build production app
249+ run : yarn build:prod
250+ env :
251+ DESKTOP_E2E_UPDATES_URL : http://127.0.0.1:51789/update
252+ DESKTOP_OAUTH_CLIENT_ID : ${{ secrets.DESKTOP_OAUTH_CLIENT_ID }}
253+ DESKTOP_OAUTH_CLIENT_SECRET :
254+ ${{ secrets.DESKTOP_OAUTH_CLIENT_SECRET }}
255+ APPLE_ID : ${{ secrets.APPLE_ID }}
256+ APPLE_ID_PASSWORD : ${{ secrets.APPLE_ID_PASSWORD }}
257+ APPLE_TEAM_ID : ${{ secrets.APPLE_TEAM_ID }}
258+ APPLE_APPLICATION_CERT : ${{ secrets.APPLE_APPLICATION_CERT }}
259+ KEY_PASSWORD : ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }}
260+ npm_config_arch : ${{ matrix.arch }}
261+ TARGET_ARCH : ${{ matrix.arch }}
262+ - name : Prepare testing environment
263+ run : yarn test:setup
264+ env :
265+ npm_config_arch : ${{ matrix.arch }}
266+ - if : runner.os == 'Windows'
267+ uses : ./.github/actions/setup-windows-signing
268+ with :
269+ enabled : ${{ inputs.sign }}
270+ azure-client-id : ${{ secrets.AZURE_CODE_SIGNING_CLIENT_ID }}
271+ azure-tenant-id : ${{ secrets.AZURE_CODE_SIGNING_TENANT_ID }}
272+ - name : Package production app
273+ run : yarn package
274+ env :
275+ npm_config_arch : ${{ matrix.arch }}
276+ AZURE_TENANT_ID : ${{ secrets.AZURE_CODE_SIGNING_TENANT_ID }}
277+ AZURE_CLIENT_ID : ${{ secrets.AZURE_CODE_SIGNING_CLIENT_ID }}
278+ - name : Install app on macOS
279+ if : runner.os == 'macOS'
280+ run : |
281+ rm -rf "/Applications/GitHub Desktop Plus.app"
282+ ditto "dist/GitHub Desktop Plus-darwin-arm64/GitHub Desktop Plus.app" "/Applications/GitHub Desktop Plus.app"
283+ echo "DESKTOP_E2E_APP_PATH=/Applications/GitHub Desktop Plus.app/Contents/MacOS/GitHub Desktop Plus" >> "$GITHUB_ENV"
284+ - name : Install app on Windows
285+ if : runner.os == 'Windows'
286+ shell : pwsh
287+ run : |
288+ function Write-SquirrelLogs {
289+ $logPaths = @(
290+ "$env:LOCALAPPDATA\SquirrelSetup.log",
291+ "$env:LOCALAPPDATA\GitHubDesktopPlus\SquirrelSetup.log"
292+ )
293+
294+ foreach ($logPath in $logPaths) {
295+ if (Test-Path $logPath) {
296+ Write-Host "Showing log: $logPath"
297+ Get-Content $logPath -Tail 200
298+ }
299+ }
300+ }
301+
302+ $setupExe = Get-ChildItem "dist/GitHubDesktopPlus-*-windows-${{ matrix.arch }}.exe" -ErrorAction SilentlyContinue |
303+ Sort-Object FullName -Descending |
304+ Select-Object -First 1 -ExpandProperty FullName
305+
306+ if (-not $setupExe) {
307+ throw "Unable to locate Windows installer executable"
308+ }
309+
310+ $installer = Start-Process -FilePath $setupExe -ArgumentList "/S" -PassThru
311+
312+ try {
313+ Wait-Process -Id $installer.Id -Timeout 300 -ErrorAction Stop
314+ } catch {
315+ Write-SquirrelLogs
316+ throw "Windows installer timed out after 300 seconds"
317+ }
318+
319+ Get-Process GitHubDesktopPlus -ErrorAction SilentlyContinue | Stop-Process -Force
320+
321+ $installedExe = $null
322+ for ($attempt = 0; $attempt -lt 30 -and -not $installedExe; $attempt++) {
323+ $installedExe = Get-ChildItem "$env:LOCALAPPDATA\GitHubDesktopPlus\app-*\GitHubDesktopPlus.exe" -ErrorAction SilentlyContinue |
324+ Sort-Object FullName -Descending |
325+ Select-Object -First 1 -ExpandProperty FullName
326+
327+ if (-not $installedExe) {
328+ Start-Sleep -Seconds 2
329+ }
330+ }
331+
332+ if (-not $installedExe) {
333+ Write-SquirrelLogs
334+ throw "Unable to locate installed GitHub Desktop executable"
335+ }
336+
337+ Add-Content -Path $env:GITHUB_ENV -Value "DESKTOP_E2E_APP_PATH=$installedExe"
338+ - name : Run packaged E2E smoke tests
339+ run : yarn test:e2e:run:packaged
340+ - name : Upload E2E artifacts
341+ if : ${{ always() }}
342+ uses : actions/upload-artifact@v4
343+ with :
344+ name : e2e-${{matrix.friendlyName}}-${{matrix.arch}}
345+ path : playwright-videos/**
346+ if-no-files-found : warn
347+
236348 release_github :
237349 name : Create GitHub release
238350 needs : [build, compute_version]
0 commit comments