Skip to content

Validate launcher in CI #18384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/testAndPublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ jobs:
PowerShell -Command "Set-PSRepository PSGallery -InstallationPolicy Trusted"
PowerShell -Command "Install-Module -Name SignPath -Force"
scons %sconsOutTargets% %sconsArgs% ${{ !runner.debug && '--all-cores' || '-j1'}}
- name: Validate launcher
run: ci/scripts/validateLauncher.ps1
env:
expectSigned: ${{ !!(github.event_name == 'push' && secrets.API_SIGNING_TOKEN) }}
- name: Upload launcher
id: uploadLauncher
uses: actions/upload-artifact@v4
Expand Down
2 changes: 1 addition & 1 deletion appveyor/scripts/sign.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ param(
[string]$FileToSign
)

Submit-SigningRequest -ApiToken $ApiToken -InputArtifactPath $FileToSign -OutputArtifactPath $FileToSign -OrganizationId "12147e94-bba9-4fef-b29b-300398e90c5a" -ProjectSlug "NVDA" -SigningPolicySlug "release_signing_policy" -WaitForCompletion -Force
# Submit-SigningRequest -ApiToken $ApiToken -InputArtifactPath $FileToSign -OutputArtifactPath $FileToSign -OrganizationId "12147e94-bba9-4fef-b29b-300398e90c5a" -ProjectSlug "NVDA" -SigningPolicySlug "release_signing_policy" -WaitForCompletion -Force
35 changes: 35 additions & 0 deletions ci/scripts/validateLauncher.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
echo "Validating launcher."
$launcherName="output\nvda*.exe"
echo "launcherName=$launcherName; expectSigned=$env:expectSigned"
echo "Checking existance"
if (-not (Test-Path -Path $launcherName -PathType Leaf)) {
echo "File doesn't exist."
Write-Output "FAIL: Launcher verification. The launcher does not exist." >> $env:GITHUB_STEP_SUMMARY
exit 1
}
echo "File exists."
if ($env:expectSigned) {
echo "Checking signature"
$authenticodeSignature = Get-AuthenticodeSignature -FilePath $launcherName
if (($authenticodeSignature).Status -ne 'Valid') {
echo "Signature not valid."
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module -Name FormatMarkdownTable -Force
Write-Output @"
FAIL: Launcher validation. Expected the launcher to be signed.
<details>
<summary>Signature details</summary>

$($authenticodeSignature | Format-MarkdownTableTableStyle -HideStandardOutput -ShowMarkdown -DoNotCopyToClipboard)

</details>
"@ >> $env:GITHUB_STEP_SUMMARY
exit 1
} else {
echo "Signature valid."
}
echo $authenticodeSignature
} else {
echo "Not checking signature."
}
echo "Launcher verification passed."
Loading