mirror of
https://github.com/fumiama/terasu-cloudflared.git
synced 2026-06-12 06:00:25 +08:00
TUN-9863: Introduce Code Signing for Windows Builds
* TUN-9863: Introduce Code Signing for Windows Builds This commit adds a signing step to the build script for windows binaries. Since we package the MSI on Linux, this commit adds another CI step that depends on package-windows and signs all of the windows packages. To do so, we use azuresigntool which relies on a certificate stored in Azure Vault. Closes TUN-9863
This commit is contained in:
26
.ci/scripts/windows/sign-msi.ps1
Normal file
26
.ci/scripts/windows/sign-msi.ps1
Normal file
@@ -0,0 +1,26 @@
|
||||
# Sign Windows artifacts using azuretool
|
||||
# This script processes MSI files from the artifacts directory
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Define paths
|
||||
$ARTIFACT_DIR = "artifacts"
|
||||
$TIMESTAMP_RFC3161 = "http://timestamp.digicert.com"
|
||||
|
||||
Write-Host "Looking for Windows artifacts to sign in $ARTIFACT_DIR..."
|
||||
|
||||
# Find all Windows MSI files
|
||||
$msiFiles = Get-ChildItem -Path $ARTIFACT_DIR -Filter "cloudflared-windows-*.msi" -ErrorAction SilentlyContinue
|
||||
|
||||
if ($msiFiles.Count -eq 0) {
|
||||
Write-Host "No Windows MSI files found in $ARTIFACT_DIR"
|
||||
exit 1
|
||||
}
|
||||
|
||||
Write-Host "Found $($msiFiles.Count) file(s) to sign:"
|
||||
foreach ($file in $msiFiles) {
|
||||
Write-Host "Running azuretool sign for $($file.Name)"
|
||||
azuresigntool.exe sign -kvu $env:KEY_VAULT_URL -kvi "$env:KEY_VAULT_CLIENT_ID" -kvs "$env:KEY_VAULT_SECRET" -kvc "$env:KEY_VAULT_CERTIFICATE" -kvt "$env:KEY_VAULT_TENANT_ID" -tr "$TIMESTAMP_RFC3161" -d "Cloudflare Tunnel Daemon" .\\$ARTIFACT_DIR\\$($file.Name)
|
||||
}
|
||||
|
||||
Write-Host "Signing process completed"
|
||||
Reference in New Issue
Block a user