Skip to content

Commit 776bf99

Browse files
authored
Merge pull request #446 from dotnet/codesign
Code sign in CI builds
2 parents 1a6a873 + 174c548 commit 776bf99

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

azure-pipelines.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ resources:
2828
jobs:
2929
- job: Windows
3030
pool: Hosted Windows 2019 with VS2019
31+
variables:
32+
- group: dotnetfoundation code signing
3133
steps:
3234
- checkout: self
3335
clean: true
@@ -118,6 +120,22 @@ jobs:
118120
TargetFolder: $(Build.ArtifactStagingDirectory)/deployables
119121
flattenFolders: true
120122
displayName: Collecting deployable artifacts
123+
124+
- pwsh: >
125+
dotnet tool install --tool-path obj SignClient
126+
127+
obj/SignClient sign
128+
--baseDirectory '$(Build.ArtifactStagingDirectory)/deployables'
129+
--input '**/*'
130+
--config '$(System.DefaultWorkingDirectory)/azure-pipelines/SignClient.json'
131+
--filelist '$(System.DefaultWorkingDirectory)/azure-pipelines/signfiles.txt'
132+
--user '$(codesign_username)'
133+
--secret '$(codesign_secret)'
134+
--name 'Nerdbank.GitVersioning'
135+
--descriptionUrl 'https://github.com/dotnet/Nerdbank.GitVersioning'
136+
displayName: Code sign
137+
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
138+
121139
- task: PublishBuildArtifacts@1
122140
inputs:
123141
PathtoPublish: $(Build.ArtifactStagingDirectory)/deployables

azure-pipelines/SignClient.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"SignClient": {
3+
"AzureAd": {
4+
"AADInstance": "https://login.microsoftonline.com/",
5+
"ClientId": "c248d68a-ba6f-4aa9-8a68-71fe872063f8",
6+
"TenantId": "16076fdc-fcc1-4a15-b1ca-32c9a255900e"
7+
},
8+
"Service": {
9+
"Url": "https://codesign.dotnetfoundation.org/",
10+
"ResourceId": "https://SignService/3c30251f-36f3-490b-a955-520addb85001"
11+
}
12+
}
13+
}

azure-pipelines/signfiles.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
**/Cake.GitVersioning.dll
2+
**/Nerdbank*.dll
3+
**/nbgv.dll
4+
**/*.ps1

0 commit comments

Comments
 (0)