From 756b8b89575979f4467230ef159026387c180631 Mon Sep 17 00:00:00 2001 From: Kevin Yue Date: Thu, 19 Nov 2026 00:09:06 +0800 Subject: [PATCH] ci(windows): authenticate after compilation before signing --- .github/workflows/build-windows.yaml | 36 ++++++++++++++++++---------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-windows.yaml b/.github/workflows/build-windows.yaml index 37b64db..93fa991 100644 --- a/.github/workflows/build-windows.yaml +++ b/.github/workflows/build-windows.yaml @@ -133,16 +133,7 @@ jobs: & ./source/gp/scripts/build-openconnect-windows.ps1 -MsysRoot $env:MSYS_ROOT -MsysSubsystem ${{ steps.native.outputs.subsystem }} -Prefix $prefix & ./source/gp/scripts/test-openconnect-windows.ps1 -MsysRoot $env:MSYS_ROOT -MsysSubsystem ${{ steps.native.outputs.subsystem }} -Prefix $prefix "OPENCONNECT_WINDOWS_PREFIX=$prefix" >> $env:GITHUB_ENV - - name: Log in to Azure with GitHub OIDC - uses: azure/login@v3 - with: - client-id: ${{ vars.AZURE_SIGNING_CLIENT_ID }} - tenant-id: ${{ vars.AZURE_TENANT_ID }} - subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} - - name: Install Microsoft Artifact Signing tooling - shell: pwsh - run: Install-Module ArtifactSigning -RequiredVersion 0.1.20 -Repository PSGallery -Force -Scope CurrentUser - - name: Build and package the matching Windows runtime + - name: Build the matching Windows runtime shell: pwsh env: MSYS_ROOT: ${{ steps.msys2.outputs.msys2-location }} @@ -151,16 +142,35 @@ jobs: $log = Join-Path $env:RUNNER_TEMP 'windows-package.log' # Compiler diagnostics may contain private GUI source. Keep them on the runner. try { - & ./source/gpgui/scripts/build-windows.ps1 -Profile Release -Sign ` + & ./source/gpgui/scripts/build-windows.ps1 -Profile Release -BuildOnly ` -NativePrefix $env:OPENCONNECT_WINDOWS_PREFIX -MsysRoot $env:MSYS_ROOT -MsysSubsystem ${{ steps.native.outputs.subsystem }} ` -WintunDirectory (Join-Path $env:WINDOWS_BUILD_TOOLS 'wintun') ` -MakeNsis (Join-Path ${env:ProgramFiles(x86)} 'NSIS/makensis.exe') ` -OutputDirectory "$env:GITHUB_WORKSPACE/artifacts" *> $log } catch { python ./.ci/scripts/private-ci-diagnostics.py compile $log - throw 'Windows compilation or packaging failed; private diagnostics remain on the runner.' + throw 'Windows compilation failed; private diagnostics remain on the runner.' } - Write-Host 'Windows compilation and packaging passed.' + Write-Host 'Windows compilation passed.' + - name: Install Microsoft Artifact Signing tooling + shell: pwsh + run: Install-Module ArtifactSigning -RequiredVersion 0.1.20 -Repository PSGallery -Force -Scope CurrentUser + - name: Log in to Azure with GitHub OIDC + uses: azure/login@v3 + with: + client-id: ${{ vars.AZURE_SIGNING_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + - name: Sign and package the Windows runtime + shell: pwsh + env: + MSYS_ROOT: ${{ steps.msys2.outputs.msys2-location }} + run: | + & ./source/gpgui/scripts/build-windows.ps1 -Profile Release -SkipBuild -Sign ` + -NativePrefix $env:OPENCONNECT_WINDOWS_PREFIX -MsysRoot $env:MSYS_ROOT -MsysSubsystem ${{ steps.native.outputs.subsystem }} ` + -WintunDirectory (Join-Path $env:WINDOWS_BUILD_TOOLS 'wintun') ` + -MakeNsis (Join-Path ${env:ProgramFiles(x86)} 'NSIS/makensis.exe') ` + -OutputDirectory "$env:GITHUB_WORKSPACE/artifacts" - name: Sign and verify update payload id: sign shell: pwsh