diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 07dc28d..b80d3d2 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -145,6 +145,7 @@ jobs: } Write-Host 'Windows compilation and packaging passed.' - name: Sign and verify update payload + id: sign shell: pwsh env: UPDATE_PRIVATE_KEY: ${{ secrets.WINDOWS_UPDATE_PRIVATE_KEY }} @@ -173,6 +174,7 @@ jobs: if ($installer.Count -ne 1) { throw 'Expected exactly one Windows installer.' } & ./source/gp/scripts/test-windows-installer.ps1 -Installer $installer[0].FullName -Architecture $env:BUILD_ARCHITECTURE -Build $env:GPGUI_BUILD_VERSION - uses: actions/upload-artifact@v7 + if: ${{ !cancelled() && steps.sign.outcome == 'success' }} with: name: artifact-gpgui-windows-${{ inputs.architecture }} path: | @@ -180,5 +182,6 @@ jobs: artifacts/*.sig artifacts/*.sha256 artifacts/*.zip + overwrite: true if-no-files-found: error retention-days: 7 diff --git a/scripts/test-windows-installer.ps1 b/scripts/test-windows-installer.ps1 index 8eb0c0e..9ec56e1 100644 --- a/scripts/test-windows-installer.ps1 +++ b/scripts/test-windows-installer.ps1 @@ -12,7 +12,12 @@ if ((Test-Path $destination) -or (Get-Service GPConnect -ErrorAction SilentlyCon throw 'Run this installer test on a clean Windows test machine.' } $process = Start-Process $Installer -ArgumentList '/S' -PassThru -Wait -if ($process.ExitCode -ne 0) { throw 'The installer failed.' } +if ($process.ExitCode -ne 0) { + # This test requires an empty CI installation; this log contains only installer operations. + $log = Join-Path $env:ProgramData 'GP Connect\installer.log' + if (Test-Path $log) { Get-Content $log -Tail 80 | Write-Host } + throw "The installer failed with exit code $($process.ExitCode)." +} $info = Get-Content (Join-Path $destination 'build-info.json') -Raw | ConvertFrom-Json if ($info.architecture -ne $Architecture -or [string]$info.build_version -ne $Build) { throw 'The installed package identity does not match.' } $service = Get-CimInstance Win32_Service -Filter "Name='GPConnect'"