-
Notifications
You must be signed in to change notification settings - Fork 256
/
.vsts-ci.yml
202 lines (180 loc) · 7.3 KB
/
.vsts-ci.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
resources:
repositories:
- repository: 1ESPipelineTemplates
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
# The variables `_DotNetArtifactsCategory` and `_DotNetValidationArtifactsCategory` are required for proper publishing of build artifacts. See https://github.com/dotnet/roslyn/pull/38259
variables:
- name: _DotNetArtifactsCategory
value: .NETCore
- name: _DotNetValidationArtifactsCategory
value: .NETCoreValidation
# Branches that trigger a build on commit
trigger:
- main
- dev17.0
extends:
template: v1/1ES.Official.PipelineTemplate.yml@1ESPipelineTemplates
parameters:
pool:
name: VSEngSS-MicroBuild2022-1ES
demands:
- cmd
sdl:
# We generate SBOM ourselves, so don't need steps injected by 1ES.
sbom:
enabled: false
policheck:
enabled: true
tsa:
enabled: true
configFile: '$(Build.SourcesDirectory)/eng/TSAConfig.gdntsa'
customBuildTags:
- ES365AIMigrationTooling
stages:
- stage: build
displayName: Build
jobs:
- ${{ if eq(variables['Build.SourceBranch'], 'refs/heads/main') }}:
- template: /eng/common/templates-official/job/onelocbuild.yml@self
parameters:
CreatePr: true
LclSource: lclFilesfromPackage
LclPackageId: 'LCL-JUNO-PROD-ROSLYNSDK'
- job: OfficialBuild
displayName: Official Build
templateContext:
outputs:
- output: pipelineArtifact
displayName: 'Publish Logs'
condition: always()
targetPath: '$(Build.SourcesDirectory)\artifacts\log\$(BuildConfiguration)'
artifactName: 'Logs'
# Publish an artifact that the RoslynInsertionTool is able to find by its name.
- output: pipelineArtifact
displayName: 'Publish Artifact VSSetup'
condition: succeeded()
targetPath: 'artifacts\VSSetup\$(BuildConfiguration)'
artifactName: 'VSSetup'
# Publish our NuPkgs as an artifact. The name of this artifact must be PackageArtifacts as the
# arcade templates depend on the name.
- output: buildArtifacts
displayName: 'Publish Artifact Packages'
condition: succeeded()
PathtoPublish: 'artifacts\packages\$(BuildConfiguration)'
ArtifactName: 'PackageArtifacts'
# Publish Asset Manifests for Build Asset Registry job
- output: buildArtifacts
displayName: 'Publish Asset Manifests'
condition: succeeded()
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/AssetManifest'
ArtifactName: AssetManifests
# Publishes setup VSIXes to a drop.
# Note: The insertion tool looks for the display name of this task in the logs.
- output: microBuildVstsDrop
displayName: Upload VSTS Drop
condition: succeeded()
dropName: $(VisualStudioDropName)
dropFolder: 'artifacts\VSSetup\$(BuildConfiguration)\Insertion'
accessToken: $(System.AccessToken)
steps:
# Needed for SBOM tool
- task: UseDotNet@2
displayName: 'Use .NET Core 3.1 runtime'
inputs:
packageType: runtime
version: 3.1.28
installationPath: '$(Build.SourcesDirectory)\.dotnet'
# Needed because the build fails the NuGet Tools restore without it
- task: UseDotNet@2
displayName: 'Use .NET Core sdk'
inputs:
packageType: sdk
useGlobalJson: true
workingDirectory: '$(Build.SourcesDirectory)'
# Needed to restore the Microsoft.DevDiv.Optimization.Data.PowerShell package
- task: NuGetCommand@2
displayName: Restore internal tools
inputs:
command: restore
feedsToUse: config
restoreSolution: 'eng\common\internal\Tools.csproj'
nugetConfigPath: 'NuGet.config'
restoreDirectory: '$(Build.SourcesDirectory)\.packages'
- task: ms-vseng.MicroBuildTasks.30666190-6959-11e5-9f96-f56098202fef.MicroBuildSigningPlugin@1
displayName: Install Signing Plugin
inputs:
signType: $(SignType)
esrpSigning: true
condition: and(succeeded(), ne(variables['SignType'], ''))
- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1
displayName: Install Swix Plugin
- task: PowerShell@2
inputs:
targetType: 'filePath'
filePath: eng\common\Build.ps1
arguments: > # Use this to avoid newline characters in multiline string
-restore
-build
-sign
-pack
-publish
-ci
-configuration $(BuildConfiguration)
/p:OfficialBuildId=$(Build.BuildNumber)
/p:VisualStudioDropName=$(VisualStudioDropName)
/p:DotNetSignType=$(SignType)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotnetPublishUsingPipelines=true
/p:GenerateSbom=true
displayName: Build
- template: /eng/common/templates-official/steps/generate-sbom.yml@self
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
displayName: Cleanup
condition: always()
# Publish to Build Asset Registry
- template: /eng/common/templates-official/job/publish-build-assets.yml@self
parameters:
publishUsingPipelines: true
dependsOn:
- OfficialBuild
queue:
name: Hosted VS2017
- stage: analysis
displayName: Code analysis
jobs:
- job: codeql
displayName: CodeQL
timeoutInMinutes: 120
variables:
# CG is handled in the primary CI pipeline
- name: skipComponentGovernanceDetection
value: true
# Force CodeQL enabled so it may be run on any branch
- name: Codeql.Enabled
value: true
# Do not let CodeQL 3000 Extension gate scan frequency
- name: Codeql.Cadence
value: 0
- name: Codeql.TSAEnabled
value: true
steps:
- task: UseDotNet@2
inputs:
useGlobalJson: true
- script: eng\common\cibuild.cmd
-configuration Release
-prepareMachine
/p:Test=false
displayName: Windows Build
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: /eng/common/templates-official/post-build/post-build.yml@self
parameters:
publishingInfraVersion: 3
# Symbol validation is not entirely reliable as of yet, so should be turned off until
# https://github.com/dotnet/arcade/issues/2871 is resolved.
enableSymbolValidation: false
enableSourceLinkValidation: false