diff --git a/.github/workflows/qa-azure.yaml b/.github/workflows/qa-azure.yaml index 4c9fd052a..b95a89d81 100644 --- a/.github/workflows/qa-azure.yaml +++ b/.github/workflows/qa-azure.yaml @@ -50,6 +50,16 @@ jobs: uses: actions/setup-go@v4 with: go-version-file: "go.work" + - name: Set up the certfificate + shell: powershell + run: | + New-Item -ItemType directory -Path certificate + Set-Content -Path certificate\certificate.txt -Value '${{ secrets.CERTIFICATE }}' + certutil -decode certificate\certificate.txt certificate\certificate.pfx + + $pwd = ConvertTo-SecureString '${{ secrets.CERTIFICATE_PASSWORD }}' -AsPlainText -Force + -Password $pwd -CertStoreLocation Cert:LocalMachine\Trust -FilePath certificate\certificate.pfx + Import-PfxCertificate -Password $pwd -CertStoreLocation Cert:CurrentUser\My -FilePath certificate\certificate.pfx - name: Test id: run-tests shell: powershell diff --git a/tools/build/build-appx.ps1 b/tools/build/build-appx.ps1 index 17b6941e8..910668be1 100644 --- a/tools/build/build-appx.ps1 +++ b/tools/build/build-appx.ps1 @@ -44,10 +44,12 @@ function Update-Certificate { # Finding local certificate $certificate_path = "${PSScriptRoot}\.certificate_thumbprint" if (! (Test-Path "${certificate_path}") ) { - Write-Error "You need a certificate to build and install the Appx. ` + Write-Warning "You need a certificate to build and install the Appx. ` Create and install a certificate, and write its thumbprint in ${certificate_path}.` See https://learn.microsoft.com/en-us/windows/win32/appxpkg/how-to-create-a-package-signing-certificate for more details" - exit 1 + + Write-Output "Continuing with default certificate" + return } $certificate_thumbprint = Get-Content ${certificate_path}