@@ -2,8 +2,9 @@ parameters:
22 - name : timestamper
33 type : string
44 displayName : Time Stamper URL
5- default : ' http://timestamp.digicert .com'
5+ default : ' http://timestamp.acs.microsoft .com'
66 values :
7+ - ' http://timestamp.acs.microsoft.com'
78 - ' http://timestamp.sectigo.com'
89 - ' http://timestamp.digicert.com'
910 - ' http://aatl-timestamp.globalsign.com/tsa/aohfewat2389535fnasgnlg5m23'
@@ -60,13 +61,15 @@ variables:
6061- name : buildUser
6162 value : ' $(Build.QueuedBy)'
6263- name : ' timestamper'
63- value : ' http://timestamp.comodoca.com '
64+ value : ${{ parameters.timestamper }}
6465- name : ' git_commit_ids'
6566 value : ${{ parameters.git_commit_ids }}
6667- name : ' project_to_build'
6768 value : ${{ parameters.project_to_build }}
6869- name : ' target'
6970 value : ' PackIfChanged'
71+ - name : ' nuget_version'
72+ value : ' >=6.6.1'
7073
7174steps :
7275- checkout : self
@@ -85,15 +88,6 @@ steps:
8588 inputs :
8689 secureFile : ' 61ad38e7-05ff-4421-aea8-e3241b75c7a1'
8790
88- - task : PowerShell@2
89- displayName : ' Install Certificate'
90- inputs :
91- targetType : ' filePath'
92- filePath : ' build/ImportCert.ps1'
93- env :
94- password : $(pfx-password)
95- pfx : $(c3d-codesign)
96-
9791- task : PowerShell@2
9892 displayName : ' Get Commit IDs'
9993 env :
@@ -112,10 +106,25 @@ steps:
112106 Write-Host "Commit IDs: $git_commit_ids"
113107 Write-Host ("##vso[task.setvariable variable=git_commit_ids;]$git_commit_ids")
114108
109+ - task : UseDotNet@2
110+ displayName : ' Use .NET SDK'
111+ inputs :
112+ packageType : ' sdk'
113+ useGlobalJson : true
114+ installationPath : $(Agent.ToolsDirectory)/dotnet
115+
116+ # Install the code signing tool
117+ - task : DotNetCoreCLI@2
118+ inputs :
119+ command : custom
120+ custom : tool
121+ arguments : update sign --global --version 0.9.1-beta.23530.1
122+ displayName : Install SignTool tool
123+
115124- task : NuGetToolInstaller@1
116- displayName : ' Use NuGet >=6.6.1 '
125+ displayName : ' Use NuGet $(nuget_version) '
117126 inputs :
118- versionSpec : ' >=6.6.1 '
127+ versionSpec : ' $(nuget_version) '
119128 checkLatest : true
120129
121130- task : VisualStudioTestPlatformInstaller@1
@@ -176,12 +185,25 @@ steps:
176185 Write-Host "Package Count: $($packages.Count)"
177186 Write-Host ("##vso[task.setvariable variable=package_count;]$($packages.Count)")
178187
179- - task : NuGetCommand@2
188+ # Run the signing command
189+ - task : PowerShell@2
190+ displayName : Sign packages
180191 condition : and(succeeded(), ne(variables['package_count'],0))
181- displayName : ' NuGet Sign'
182192 inputs :
183- command : custom
184- arguments : ' sign $(Build.ArtifactStagingDirectory)\*.nupkg -Timestamper $(timestamper) -CertificateFingerprint $(app_pfx_thumbprint)'
193+ targetType : inline
194+ script : |
195+ sign code azure-key-vault `
196+ "**/*.nupkg" `
197+ --base-directory "$(Build.ArtifactStagingDirectory)" `
198+ -d "Cynthia Z E MacLeod" `
199+ -u "https://github.com/CZEMacLeod" `
200+ -kvu "$(SignVaultURL)" `
201+ -kvc "c3d-codesign" `
202+ -v information `
203+ -t "$(timestamper)" `
204+ --azure-key-vault-tenant-id "$(SignTenantId)" `
205+ --azure-key-vault-client-id "$(SignClientId)" `
206+ --azure-key-vault-client-secret '$(SignClientSecret)'
185207
186208 - task : CopyFiles@2
187209 displayName : Create nuget publish config
@@ -248,12 +270,4 @@ steps:
248270 gitHubConnection : github-czemacleod
249271 repositoryName : CZEMacLeod/C3D.Extensions.Logging
250272 assets : $(Build.ArtifactStagingDirectory)/*.nupkg
251- addChangeLog : true
252-
253- - task : PowerShell@2
254- displayName : ' Remove Cert'
255- inputs :
256- targetType : filePath
257- filePath : ' build/RemoveCert.ps1'
258- arguments : ' -thumb $(app_pfx_thumbprint)'
259- condition : always()
273+ addChangeLog : true
0 commit comments