|
1 | 1 | $currentDirectory = split-path $MyInvocation.MyCommand.Definition |
2 | 2 |
|
3 | 3 | # See if we have the ClientSecret available |
4 | | -if ([string]::IsNullOrEmpty($env:SignClientSecret)) { |
| 4 | +if ([string]::IsNullOrEmpty($env:VaultSignClientSecret)) { |
5 | 5 | Write-Host "Client Secret not found, not signing packages" |
6 | 6 | return; |
7 | 7 | } |
8 | 8 |
|
9 | | -dotnet tool install --tool-path . SignClient |
| 9 | +dotnet tool install --tool-path . sign --version 0.9.1-beta.25278.1 |
10 | 10 |
|
11 | | -# Setup Variables we need to pass into the sign client tool |
12 | | -$appSettings = "$currentDirectory\SignClient.json" |
13 | | - |
14 | | -$filesToSign = Get-ChildItem -Recurse $Env:ArtifactDirectory\* -Include *.nupkg,*.vsix | Select-Object -ExpandProperty FullName |
| 11 | +$filesToSign = Get-ChildItem -Recurse $Env:ArtifactDirectory\* -Include *.nupkg | Select-Object -ExpandProperty FullName |
15 | 12 |
|
16 | 13 | foreach ($fileToSign in $filesToSign) { |
17 | 14 | Write-Host "Submitting $fileToSign for signing" |
18 | | - .\SignClient 'sign' -c $appSettings -i $fileToSign -r $env:SignClientUser -s $env:SignClientSecret -n "$env:SignPackageName" -d "$env:SignPackageDescription" -u "$env:build_repository_uri" |
| 15 | + |
| 16 | + .\sign code azure-key-vault ` |
| 17 | + $fileToSign ` |
| 18 | + --publisher-name "$env:SignPackageName" ` |
| 19 | + --description "$env:SignPackageDescription" ` |
| 20 | + --description-url "$env:build_repository_uri" ` |
| 21 | + --azure-key-vault-tenant-id "$env:VaultSignTenantId" ` |
| 22 | + --azure-key-vault-client-id "$env:VaultSignClientId" ` |
| 23 | + --azure-key-vault-client-secret "$env:VaultSignClientSecret" ` |
| 24 | + --azure-key-vault-certificate "$env:VaultSignCertificate" ` |
| 25 | + --azure-key-vault-url "$env:VaultSignUrl" ` |
| 26 | + --verbosity information |
| 27 | + |
| 28 | + if ($LASTEXITCODE -ne 0) { |
| 29 | + Write-Error "Failed to sign $fileToSign" |
| 30 | + exit $LASTEXITCODE |
| 31 | + } |
| 32 | + |
19 | 33 | Write-Host "Finished signing $fileToSign" |
20 | 34 | } |
21 | 35 |
|
|
0 commit comments