hex/scripts/windows-authenticode.ps1
Dax Raad 2d222022a5 feat(release): publish every platform to the Anomaly release service
The Release workflow uploads each target and the release to anoma.ly/release (dev.anoma.ly/release for staging) with curl and its GitHub OIDC token, records the AUR, Homebrew, and Nix distributions, mirrors the files to GitHub, and builds hex-bin from the published file. The ed25519 feeds, appcast generation, and Sparkle ZIP naming are gone; the 2.3.1 feeds stay frozen. Builds and installers use the release service names, the installers read the stable manifest and write the direct-install receipt, and the site reads its download links from the manifest.
2026-10-24 10:15:59 -04:00

23 lines
1.1 KiB
PowerShell

# Checks the Authenticode signatures CI applied through Azure Artifact
# Signing to every executable and installer in the given folders. Run after
# both the executables and the installers are signed.
#
# scripts/windows-authenticode.ps1 -Folders dist, installers
[CmdletBinding()]
param(
[Parameter(Mandatory)] [string[]]$Folders
)
$ErrorActionPreference = 'Stop'
$files = @($Folders | ForEach-Object { Get-ChildItem -LiteralPath $_ -Filter '*.exe' })
if ($files.Count -eq 0) { throw "No executables in $($Folders -join ', ')." }
foreach ($file in $files) {
$signature = Get-AuthenticodeSignature -LiteralPath $file.FullName
if ($signature.Status -ne 'Valid') {
throw "$($file.Name) is not validly signed: $($signature.Status) $($signature.StatusMessage)"
}
# Artifact Signing certificates last days; only the timestamp keeps
# the signature valid afterwards.
if (-not $signature.TimeStamperCertificate) { throw "$($file.Name) has no RFC 3161 timestamp." }
Write-Output "ok - $($file.Name) signed by $($signature.SignerCertificate.Subject)"
}