Skip to content

Commit

Permalink
Set up certificate
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardGomezEscandell committed Sep 19, 2023
1 parent 912a00e commit 976162a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/qa-azure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions tools/build/build-appx.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit 976162a

Please sign in to comment.