Skip to content

Commit

Permalink
Set up CI with Azure Pipelines
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
aflorescu579774 committed Aug 19, 2024
1 parent b95bada commit ead0216
Showing 1 changed file with 70 additions and 0 deletions.
70 changes: 70 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# ASP.NET
# Build and test ASP.NET projects.
# Add steps that publish symbols, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/aspnet/build-aspnet-4

trigger:
- master

pool:
vmImage: 'windows-latest'

steps:
- task: PowerShell@2
inputs:
targetType: 'inline'
script: |
param(
[string]$sigingListFile = "$psscriptroot\filestosign.csv",
[string]$signingRoot = "$PSScriptRoot\..\..\..\..",
[string]$KeyVaultUrl = "https://sdl-lt-keyvault.vault.azure.net/",
[string]$TimestampServer="http://timestamp.digicert.com",
[string]$CertificateName="SDLPLCAuthenticode"
)
$SigningClientId = "unset"
$SigningSecret = "unset"
if ($null -ne $env:KeyVaultUrl)
{
$KeyVaultUrl = $env:KeyVaultUrl
}
if ($null -ne $env:CurrentCertificateName)
{
$CertificateName = $env:CurrentCertificateName
}
if ($env:SigningSecret -ne $null)
{
$SigningSecret = $env:SigningSecret
}
if ($env:SigningClientId -ne $null)
{
$SigningClientId = $env:SigningClientId
}
#files to sign are now in a csv to keep the code generic -Header "Description", "Path"
$FilesToSign = import-csv -Path $sigingListFile
$buildRoot="$psscriptroot\..\..\..\.."
$SrcRoot="$psscriptroot\..\..\.."
$ToolPath=[System.IO.Path]::GetFullPath("$SrcRoot\tools\azuresigntool.exe");
$signingRoot=[System.IO.Path]::GetFullPath("$signingRoot");
function AuthenticodeSign
{
param( [string]$path, [string]$description)
attrib -r "$path"
& "$ToolPath" sign -kvu "$KeyVaultUrl" -kvi "$SigningClientId" -kvs "$SigningSecret" -kvc "$CertificateName" -d "$description" -tr "$TimestampServer" -td sha512 -fd sha512 -v "$path"
}
foreach ($item in $FilesToSign)
{
$path=[System.IO.Path]::GetFullPath($signingRoot + $item.Path);
AuthenticodeSign "$path" $item.Description
}

0 comments on commit ead0216

Please sign in to comment.