1
+ parameters :
2
+ - name : PackagesPath
3
+ type : string
4
+ default : ' '
5
+
6
+ steps :
7
+ - checkout : self
8
+ clean : true
9
+ fetchDepth : 1
10
+
11
+ - task : UseDotNet@2
12
+ displayName : ' Use .NET Core sdk (for code signing)'
13
+ inputs :
14
+ packageType : sdk
15
+ version : 3.1.x
16
+
17
+ # Expand packages as zip
18
+ - task : PowerShell@2
19
+ displayName : ' Expand nuget packages'
20
+ inputs :
21
+ packagePath : filePath
22
+ filePath : ' $(Build.SourcesDirectory)/.azdo/pipelines/scripts/ExpandNugetPackages.ps1'
23
+ arguments : ' -packagePath "${{ parameters.PackagesPath }}"'
24
+
25
+ - task : EsrpCodeSigning@1
26
+ displayName : ' Sign Package DLLs'
27
+ inputs :
28
+ ConnectedServiceName : ' ESRP Code Signing'
29
+ FolderPath : ' ${{ parameters.PackagesPath }}'
30
+ Pattern : ' Microsoft.AzureHealth.DataServices.*.dll,Microsoft.Capl.*.dll'
31
+ UseMinimatch : false
32
+ signConfigType : ' inlineSignParams'
33
+ inlineOperation : |
34
+ [
35
+ {
36
+ "keyCode": "CP-230012",
37
+ "operationSetCode": "SigntoolSign",
38
+ "parameters": [
39
+ {
40
+ "parameterName": "OpusName",
41
+ "parameterValue": "Microsoft"
42
+ },
43
+ {
44
+ "parameterName": "OpusInfo",
45
+ "parameterValue": "http://www.microsoft.com"
46
+ },
47
+ {
48
+ "parameterName": "PageHash",
49
+ "parameterValue": "/NPH"
50
+ },
51
+ {
52
+ "parameterName": "FileDigest",
53
+ "parameterValue": "/fd sha256"
54
+ },
55
+ {
56
+ "parameterName": "TimeStamp",
57
+ "parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
58
+ }
59
+ ],
60
+ "toolName": "sign",
61
+ "toolVersion": "1.0"
62
+ },
63
+ {
64
+ "keyCode": "CP-230012",
65
+ "operationSetCode": "SigntoolVerify",
66
+ "parameters": [ ],
67
+ "toolName": "sign",
68
+ "toolVersion": "1.0"
69
+ }
70
+ ]
71
+ SessionTimeout : ' 60'
72
+ MaxConcurrency : ' 50'
73
+ MaxRetryAttempts : ' 5'
74
+
75
+ # Repackage with signed dlls
76
+ - task : PowerShell@2
77
+ displayName : ' Repack nuget packages'
78
+ inputs :
79
+ packagePath : filePath
80
+ filePath : ' $(Build.SourcesDirectory)/.azdo/pipelines/scripts/RepackNugetPackages.ps1'
81
+ arguments : ' -packageFolderPath "${{ parameters.PackagesPath }}" -signedPath "${{ parameters.PackagesPath }}-signed"'
82
+
83
+ - task : CopyFiles@2
84
+ displayName : ' Copy symbols'
85
+ inputs :
86
+ sourceFolder : ${{ parameters.PackagesPath }}
87
+ contents : ' *.snupkg'
88
+ targetFolder : ${{ parameters.PackagesPath }}-signed
89
+
90
+ # Sign Packages
91
+ - task : EsrpCodeSigning@1
92
+ displayName : ' Sign Nuget Packages'
93
+ inputs :
94
+ ConnectedServiceName : ' ESRP Code Signing'
95
+ FolderPath : ' ${{ parameters.PackagesPath }}-signed/'
96
+ Pattern : ' Microsoft.AzureHealth.DataServices*.nupkg,Microsoft.Capl*.nupkg'
97
+ UseMinimatch : false
98
+ signConfigType : ' inlineSignParams'
99
+ inlineOperation : |
100
+ [
101
+ {
102
+ "keyCode": "CP-401405",
103
+ "operationSetCode": "NuGetSign",
104
+ "parameters": [ ],
105
+ "toolName": "sign",
106
+ "toolVersion": "1.0"
107
+ },
108
+ {
109
+ "keyCode": "CP-401405",
110
+ "operationSetCode": "NuGetVerify",
111
+ "parameters": [ ],
112
+ "toolName": "sign",
113
+ "toolVersion": "1.0"
114
+ }
115
+ ]
116
+ SessionTimeout : ' 60'
117
+ MaxConcurrency : ' 50'
118
+ MaxRetryAttempts : ' 5'
0 commit comments