Fix clean runner MSIX publishing
This commit is contained in:
parent
1f02310d45
commit
2c31a10216
3 changed files with 8 additions and 4 deletions
7
.github/workflows/windows-build.yml
vendored
7
.github/workflows/windows-build.yml
vendored
|
|
@ -32,9 +32,10 @@ jobs:
|
||||||
- name: Build test-signed MSIX installer
|
- name: Build test-signed MSIX installer
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$directory = Join-Path $env:RUNNER_TEMP 'smm-test-signing'
|
$directory = Join-Path $env:RUNNER_TEMP 'smm-test-signing'
|
||||||
$password = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(24))
|
$password = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(24))
|
||||||
./build/windows/New-TestSigningCertificate.ps1 -OutputDirectory $directory -Password $password
|
Write-Output "::add-mask::$password"
|
||||||
|
./build/windows/New-TestSigningCertificate.ps1 -OutputDirectory $directory -Password $password
|
||||||
./build/windows/Build-Installer.ps1 `
|
./build/windows/Build-Installer.ps1 `
|
||||||
-CertificatePath (Join-Path $directory 'server-monitor-manager-test-signing.pfx') `
|
-CertificatePath (Join-Path $directory 'server-monitor-manager-test-signing.pfx') `
|
||||||
-CertificatePassword $password
|
-CertificatePassword $password
|
||||||
|
|
|
||||||
2
.github/workflows/windows-release.yml
vendored
2
.github/workflows/windows-release.yml
vendored
|
|
@ -31,6 +31,7 @@ jobs:
|
||||||
$directory = Join-Path $env:RUNNER_TEMP 'smm-signing'
|
$directory = Join-Path $env:RUNNER_TEMP 'smm-signing'
|
||||||
New-Item -ItemType Directory -Path $directory -Force | Out-Null
|
New-Item -ItemType Directory -Path $directory -Force | Out-Null
|
||||||
if ($env:SIGNING_CERTIFICATE_BASE64 -and $env:SIGNING_CERTIFICATE_PASSWORD) {
|
if ($env:SIGNING_CERTIFICATE_BASE64 -and $env:SIGNING_CERTIFICATE_PASSWORD) {
|
||||||
|
Write-Output "::add-mask::$env:SIGNING_CERTIFICATE_PASSWORD"
|
||||||
$pfx = Join-Path $directory 'trusted-signing.pfx'
|
$pfx = Join-Path $directory 'trusted-signing.pfx'
|
||||||
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGNING_CERTIFICATE_BASE64))
|
[IO.File]::WriteAllBytes($pfx, [Convert]::FromBase64String($env:SIGNING_CERTIFICATE_BASE64))
|
||||||
"certificate=$pfx" >> $env:GITHUB_OUTPUT
|
"certificate=$pfx" >> $env:GITHUB_OUTPUT
|
||||||
|
|
@ -38,6 +39,7 @@ jobs:
|
||||||
"test_certificate=false" >> $env:GITHUB_OUTPUT
|
"test_certificate=false" >> $env:GITHUB_OUTPUT
|
||||||
} else {
|
} else {
|
||||||
$password = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(24))
|
$password = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(24))
|
||||||
|
Write-Output "::add-mask::$password"
|
||||||
./build/windows/New-TestSigningCertificate.ps1 -OutputDirectory $directory -Password $password
|
./build/windows/New-TestSigningCertificate.ps1 -OutputDirectory $directory -Password $password
|
||||||
"certificate=$(Join-Path $directory 'server-monitor-manager-test-signing.pfx')" >> $env:GITHUB_OUTPUT
|
"certificate=$(Join-Path $directory 'server-monitor-manager-test-signing.pfx')" >> $env:GITHUB_OUTPUT
|
||||||
"public_certificate=$(Join-Path $directory 'server-monitor-manager-test-signing.cer')" >> $env:GITHUB_OUTPUT
|
"public_certificate=$(Join-Path $directory 'server-monitor-manager-test-signing.cer')" >> $env:GITHUB_OUTPUT
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ try {
|
||||||
throw "The certificate subject must match Package.appxmanifest Publisher=CN=AppPublisher; actual: $($signingCertificate.Subject)"
|
throw "The certificate subject must match Package.appxmanifest Publisher=CN=AppPublisher; actual: $($signingCertificate.Subject)"
|
||||||
}
|
}
|
||||||
|
|
||||||
dotnet restore $project -r win-x64 -p:Platform=x64
|
dotnet restore $project -r win-x64 -p:Platform=x64 -p:PublishReadyToRun=false
|
||||||
if ($LASTEXITCODE -ne 0) { throw 'dotnet restore failed' }
|
if ($LASTEXITCODE -ne 0) { throw 'dotnet restore failed' }
|
||||||
|
|
||||||
dotnet publish $project `
|
dotnet publish $project `
|
||||||
|
|
@ -43,6 +43,7 @@ try {
|
||||||
--runtime win-x64 `
|
--runtime win-x64 `
|
||||||
--no-restore `
|
--no-restore `
|
||||||
-p:Platform=x64 `
|
-p:Platform=x64 `
|
||||||
|
-p:PublishReadyToRun=false `
|
||||||
-p:GenerateAppxPackageOnBuild=true `
|
-p:GenerateAppxPackageOnBuild=true `
|
||||||
-p:AppxPackageSigningEnabled=true `
|
-p:AppxPackageSigningEnabled=true `
|
||||||
-p:PackageCertificateThumbprint=$($signingCertificate.Thumbprint) `
|
-p:PackageCertificateThumbprint=$($signingCertificate.Thumbprint) `
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue