forked from OData/AspNetCoreOData
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure_pipelines_nightly.yml
243 lines (243 loc) · 11.9 KB
/
azure_pipelines_nightly.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
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
trigger: none
schedules:
- cron: 0 5 * * 1,2,3,4,5
branches:
include:
- main
- dev-9.x
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
name: $(Date:yyyyMMdd).$(Rev:r)
variables:
- name: AzureServicesAuthConnectionString
value: ''
- name: BuildConfiguration
value: release
- name: BuildPlatform
value: anycpu
- name: ProductBinPath
value: $(Build.SourcesDirectory)\bin\$(BuildPlatform)\$(BuildConfiguration)
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: MSSecurity-1ES-Build-Agents-Pool
image: MSSecurity-1ES-Windows-2022
os: windows
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: build
jobs:
- job: Main
displayName: Main Build
timeoutInMinutes: 360
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Artifact - .NET output Build'
targetPath: $(Build.ArtifactStagingDirectory)\output
artifactName: dropOutput
- output: pipelineArtifact
displayName: 'Publish Artifact - SBOM'
targetPath: $(Build.ArtifactStagingDirectory)\output
artifactName: dropSBOM
- output: pipelineArtifact
displayName: 'Publish Artifact - Nuget Packages'
targetPath: $(Build.ArtifactStagingDirectory)\Nuget
artifactName: drop
- output: nuget
displayName: 'MyGet push - Nightly packages to MyGet'
packageParentPath: '$(Build.ArtifactStagingDirectory)'
packagesToPush: $(Build.ArtifactStagingDirectory)\Nuget\*Nightly*.nupkg
nuGetFeedType: external
publishFeedCredentials: 'MyGet.org - AspNetCoreOData Feed'
steps:
- checkout: self
fetchTags: true
- task: NuGetToolInstaller@1
displayName: Use NuGet >=5.2.0
inputs:
versionSpec: '>=5.2.0'
checkLatest: true
- task: UseDotNet@2
displayName: Use .NET Core SDK 8.x
inputs:
version: 8.x
includePreviewVersions: true
- task: DotNetCoreCLI@2
displayName: Build Microsoft.AspNetCore.OData
inputs:
projects: $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.csproj
arguments: --configuration $(BuildConfiguration) --no-incremental
- task: DotNetCoreCLI@2
displayName: Build Microsoft.AspNetCore.OData.NewtonsoftJson
inputs:
projects: $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.NewtonsoftJson\Microsoft.AspNetCore.OData.NewtonsoftJson.csproj
arguments: --configuration $(BuildConfiguration) --no-incremental
- task: CopyFiles@2
displayName: 'Copy Files to: $(Build.ArtifactStagingDirectory)\output'
inputs:
SourceFolder: $(Build.SourcesDirectory)\bin\$(BuildPlatform)\$(BuildConfiguration)\
Contents: '**\Microsoft.AspNetCore.OData.*'
TargetFolder: $(Build.ArtifactStagingDirectory)\output
- task: DotNetCoreCLI@2
displayName: Build UT (Microsoft.AspNetCore.OData.Tests)
inputs:
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.Tests\Microsoft.AspNetCore.OData.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-incremental
- task: DotNetCoreCLI@2
displayName: 'Build UT (Microsoft.AspNetCore.OData.NewtonsoftJson Tests) '
inputs:
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.NewtonsoftJson.Tests\Microsoft.AspNetCore.OData.NewtonsoftJson.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-incremental
- task: DotNetCoreCLI@2
displayName: Build E2E (Microsoft.AspNetCore.OData.E2E.Tests)
inputs:
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.E2E.Tests\Microsoft.AspNetCore.OData.E2E.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-incremental
- task: DotNetCoreCLI@2
displayName: Unit Tests (Microsoft.AspNetCore.OData.Tests)
inputs:
command: test
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.Tests\Microsoft.AspNetCore.OData.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-build
- task: DotNetCoreCLI@2
displayName: Unit Tests (Microsoft.AspNetCore.OData.NewtonsoftJson.Tests)
inputs:
command: test
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.NewtonsoftJson.Tests\Microsoft.AspNetCore.OData.NewtonsoftJson.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-build
- task: DotNetCoreCLI@2
displayName: E2E Tests (Microsoft.AspNetCore.OData.E2E.Tests)
inputs:
command: test
projects: $(Build.SourcesDirectory)\test\Microsoft.AspNetCore.OData.E2E.Tests\Microsoft.AspNetCore.OData.E2E.Tests.csproj
arguments: --configuration $(BuildConfiguration) --no-build
- task: UseDotNet@2
displayName: Use .NET Core SDK 2.x
inputs:
version: 2.x
- task: EsrpCodeSigning@1
displayName: ESRP CodeSigning - WebAPI OData Product Signing
inputs:
ConnectedServiceName: 'ESRP CodeSigning - OData'
FolderPath: $(ProductBinPath)
Pattern: Microsoft.AspNetCore.OData.dll,Microsoft.AspNetCore.OData.NewtonsoftJson.dll
signConfigType: inlineSignParams
inlineOperation: |-
[
{
"keyCode": "MSSharedLibSnKey",
"operationSetCode": "StrongNameSign",
"parameters": null,
"toolName": "sn.exe",
"toolVersion": "V4.6.1586.0"
},
{
"keyCode": "MSSharedLibSnKey",
"operationSetCode": "StrongNameVerify",
"parameters": null,
"toolName": "sn.exe",
"toolVersion": "V4.6.1586.0"
},
{
"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"
},
{
"keyCode": "CP-230012",
"operationSetCode": "SigntoolVerify",
"parameters": [
{
"parameterName": "VerifyAll",
"parameterValue": "/all"
}
],
"toolName": "signtool.exe",
"toolVersion": "6.2.9304.0"
}
]
VerboseLogin: true
- task: MSBuild@1
displayName: Get Nuget Package Metadata
inputs:
solution: tool/GetNugetPackageMetadata.proj
platform: $(BuildPlatform)
configuration: $(BuildConfiguration)
- task: NuGetCommand@2
displayName: NuGet - pack Microsoft.AspNetCore.OData Nightly
inputs:
command: custom
arguments: pack $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.Nightly.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic);ODataModelBuilderPackageDependency="$(ODataModelBuilderPackageDependency)";ODataLibPackageDependency="$(ODataLibPackageDependency)" -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg
- task: NuGetCommand@2
displayName: NuGet - pack Microsoft.AspNetCore.OData Release
inputs:
command: custom
arguments: pack $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.Release.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic);ODataModelBuilderPackageDependency="$(ODataModelBuilderPackageDependency)";ODataLibPackageDependency="$(ODataLibPackageDependency)" -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg
- task: NuGetCommand@2
displayName: NuGet - pack Microsoft.AspNetCore.OData.NewtonsoftJson Nightly
inputs:
command: custom
arguments: pack $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.NewtonsoftJson.Nightly.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic) -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg
- task: NuGetCommand@2
displayName: NuGet - pack Microsoft.AspNetCore.OData.NewtonsoftJson Release
inputs:
command: custom
arguments: pack $(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData.NewtonsoftJson.Release.nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Nuget -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionFullSemantic=$(VersionFullSemantic);NightlyBuildVersion=$(VersionNugetNightlyBuild);VersionNuGetSemantic=$(VersionNuGetSemantic) -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
displayName: ESRP CodeSigning - WebAPI OData Packages Signing
inputs:
ConnectedServiceName: ESRP CodeSigning - OData
FolderPath: $(Build.ArtifactStagingDirectory)\Nuget
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"
}
]
VersboseLogin: true