forked from dotnet/Open-XML-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.yml
102 lines (94 loc) · 3.27 KB
/
sign.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
steps:
- checkout: none
- download: current
artifact: unsigned
- powershell: |
$version=gci DocumentFormat.OpenXml.*.nupkg | % { $_ -match 'DocumentFormat.OpenXml.(.*).nupkg' | Out-Null; $matches[1] }
Write-Host "##vso[task.setvariable variable=Version]$version"
Write-Host "Setting version to $version"
workingDirectory: '$(Pipeline.Workspace)/unsigned'
- task: ExtractFiles@1
inputs:
archiveFilePatterns: '$(Pipeline.Workspace)/unsigned/DocumentFormat.OpenXml.$(Version).nupkg'
destinationFolder: '$(Pipeline.Workspace)/$(Version)'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'OpenXML SDK Assembly ESRP CodeSigning'
inputs:
ConnectedServiceName: 'Open-XML-SDK-ESRP'
FolderPath: '$(Pipeline.Workspace)\$(Version)'
Pattern: '**\DocumentFormat.OpenXml.dll'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft"
},
{
"parameterName": "OpusInfo",
"parameterValue": "http://www.microsoft.com"
},
{
"parameterName": "PageHash",
"parameterValue": "/NPH"
},
{
"parameterName": "FileDigest",
"parameterValue": "/fd sha256"
},
{
"parameterName": "TimeStamp",
"parameterValue": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
- task: ArchiveFiles@2
inputs:
rootFolderOrFile: '$(Pipeline.Workspace)/$(Version)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/DocumentFormat.OpenXml.$(Version).nupkg'
replaceExistingArchive: true
verbose: true
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'OpenXML SDK Nuget Pkg ESRP CodeSigning'
inputs:
ConnectedServiceName: 'Open-XML-SDK-ESRP'
FolderPath: '$(Build.ArtifactStagingDirectory)'
Pattern: '*.nupkg'
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetSign",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
},
{
"keyCode": "CP-401405",
"operationSetCode": "NuGetVerify",
"parameters": [ ],
"toolName": "sign",
"toolVersion": "1.0"
}
]
- task: CopyFiles@2
inputs:
sourceFolder: '$(Pipeline.Workspace)/unsigned'
contents: '*.snupkg'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Signed'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: 'signed'