This repository has been archived by the owner on Sep 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
release_build.yaml
158 lines (142 loc) · 4.53 KB
/
release_build.yaml
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
pool:
name: Hosted Windows 2019 with VS2019
#demands: npm
variables:
BuildConfiguration: 'release'
Codeql.Enabled: true
Codeql.Language: csharp
steps:
# required for the signing task, but should not be used for the entire build
- task: UseDotNet@2
displayName: 'Use .NET Core SDK 2.1.x'
inputs:
version: 2.1.x
# Use latest SDK for build
- task: UseDotNet@2
displayName: 'Use .NET SDK 6.x'
inputs:
version: 6.x
- task: securedevelopmentteam.vss-secure-development-tools.build-task-policheck.PoliCheck@2
displayName: 'Run PoliCheck'
inputs:
targetType: F
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@3
displayName: 'Run CredScan'
inputs:
suppressionsFile: 'build/credscan-exclusion.json'
outputFormat: pre
debugMode: false
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
displayName: 'Post Analysis'
inputs:
GdnBreakGdnToolCredScan: true
GdnBreakGdnToolPoliCheck: true
- task: DotNetCoreCLI@2
displayName: 'Build solution'
inputs:
arguments: '-c $(BuildConfiguration) /p:ClientSemVer=$(ClientSemVer) /p:SourceLinkCreate=true /p:ContinousIntegrationBuild=true'
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'Sign Binaries'
inputs:
ConnectedServiceName: 'IDDP Code Signing'
FolderPath: '$(Build.SourcesDirectory)\src'
Pattern: '**\bin\**\*.dll'
UseMinimatch: true
signConfigType: inlineSignParams
inlineOperation: |
[
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolSign",
"parameters": [
{
"parameterName": "OpusName",
"parameterValue": "Microsoft.Identity.Client.Extensions.Msal"
},
{
"parameterName": "OpusInfo",
"parameterValue": "https://www.nuget.org/packages/Microsoft.Identity.Client.Extensions.Msal/"
},
{
"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"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [ ],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
SessionTimeout: 20
- task: securedevelopmentteam.vss-secure-development-tools.build-task-binskim.BinSkim@4
displayName: 'Run BinSkim '
inputs:
InputType: Basic
AnalyzeTargetGlob: '$(Build.SourcesDirectory)\src\**\bin\**\*.dll'
AnalyzeVerbose: true
AnalyzeHashes: true
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@2
displayName: 'Check BinSkim Results'
inputs:
GdnBreakGdnToolBinSkim: true
- task: DotNetCoreCLI@2
displayName: Pack projects
inputs:
command: pack
packagesToPack: 'src/**/*.csproj'
nobuild: true
versioningScheme: byEnvVar
versionEnvVar: ClientSemVer
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: 'Sign Packages'
inputs:
ConnectedServiceName: 'IDDP Code Signing'
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"
}
]
SessionTimeout: 20
- task: AzureArtifacts.manifest-generator-task.manifest-generator-task.ManifestGeneratorTask@0
displayName: 'Get Software Bill Of Materials (SBOM)'
inputs:
BuildDropPath: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
ArtifactName: packages
- task: securedevelopmentteam.vss-secure-development-tools.build-task-uploadtotsa.TSAUpload@2
displayName: 'TSA Upload'
inputs:
GdnPublishTsaOnboard: false
GdnPublishTsaConfigFile: '$(Build.SourcesDirectory)/build/tsaConfig.json'
continueOnError: true