forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vsts-dotnet.yml
219 lines (193 loc) · 8.28 KB
/
.vsts-dotnet.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
trigger:
- master
- vs*
- exp/*
# If defined here, these values are not overrideable
# Once they exist, we should define these as "runtime parameters"
# https://github.com/Microsoft/azure-pipelines-yaml/pull/129
# variables:
# SignType: real
# SkipApplyOptimizationData: false
variables:
- name: SourceBranch
value: $(IbcSourceBranchName)
- ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/exp/') }}:
- name: SourceBranch
value: master
- name: _DotNetArtifactsCategory
value: .NETCore
- name: _DotNetValidationArtifactsCategory
value: .NETCoreValidation
stages:
- stage: build
displayName: Build
jobs:
- job: Windows_NT
pool:
name: VSEng-MicroBuildVS2019
demands:
- agent.os -equals Windows_NT
timeoutInMinutes: 180
variables:
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Publish
- group: Publish-Build-Assets
- name: TeamName
value: MSBuild
- name: VisualStudio.MajorVersion
value: 16
- name: VisualStudio.ChannelName
value: 'int.master'
- name: VisualStudio.DropName
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
steps:
- task: NuGetToolInstaller@0
inputs:
versionSpec: '4.9.2'
- 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
inputs:
signType: $(SignType)
zipSources: false
condition: and(succeeded(), in(variables['SignType'], 'test', 'real'))
- task: ms-vseng.MicroBuildTasks.965C8DC6-1483-45C9-B384-5AC75DA1F1A4.MicroBuildOptProfPlugin@1
inputs:
skipRunOptimize: true
displayName: 'Install OptProf Plugin'
# Required by MicroBuildBuildVSBootstrapper
- task: ms-vseng.MicroBuildTasks.32f78468-e895-4f47-962c-58a699361df8.MicroBuildSwixPlugin@1
inputs:
dropName: $(VisualStudio.DropName)
feedSource: 'https://devdiv-test.pkgs.visualstudio.com/_packaging/MicroBuildToolset/nuget/v3/index.json'
- script: eng/CIBuild.cmd
-configuration $(BuildConfiguration)
-officialBuildId $(Build.BuildNumber)
-officialSkipApplyOptimizationData $(SkipApplyOptimizationData)
/p:RepositoryName=$(Build.Repository.Name)
/p:VisualStudioIbcSourceBranchName=$(SourceBranch)
/p:VisualStudioDropAccessToken=$(System.AccessToken)
/p:VisualStudioDropName=$(VisualStudio.DropName)
/p:DotNetSignType=$(SignType)
/p:DotNetPublishToBlobFeed=true
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:PublishToSymbolServer=true
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:TeamName=MSBuild
/p:DotNetPublishUsingPipelines=true
displayName: Build
condition: succeeded()
# Publish OptProf configuration files
- task: ms-vscs-artifact.build-tasks.artifactDropTask-1.artifactDropTask@0
inputs:
dropServiceURI: 'https://devdiv.artifacts.visualstudio.com'
buildNumber: 'ProfilingInputs/DevDiv/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)'
sourcePath: '$(Build.SourcesDirectory)\artifacts\OptProf\$(BuildConfiguration)\Data'
toLowerCase: false
usePat: false
displayName: 'OptProf - Publish to Artifact Services - ProfilingInputs'
condition: succeeded()
# Build VS bootstrapper
# Generates $(Build.StagingDirectory)\MicroBuild\Output\BootstrapperInfo.json
- task: ms-vseng.MicroBuildTasks.0e9d0d4d-71ec-4e4e-ae40-db9896f1ae74.MicroBuildBuildVSBootstrapper@2
inputs:
vsMajorVersion: $(VisualStudio.MajorVersion)
channelName: $(VisualStudio.ChannelName)
manifests: $(VisualStudio.SetupManifestList)
outputFolder: '$(Build.SourcesDirectory)\artifacts\VSSetup\$(BuildConfiguration)\Insertion'
displayName: 'OptProf - Build VS bootstrapper'
condition: succeeded()
# Publish run settings
- task: PowerShell@2
inputs:
filePath: eng\common\sdk-task.ps1
arguments: -configuration $(BuildConfiguration)
-task VisualStudio.BuildIbcTrainingSettings
/p:VisualStudioDropName=$(VisualStudio.DropName)
/p:BootstrapperInfoPath=$(Build.StagingDirectory)\MicroBuild\Output\BootstrapperInfo.json
displayName: 'OptProf - Build IBC training settings'
condition: succeeded()
# Publish bootstrapper info
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.StagingDirectory)\MicroBuild\Output
ArtifactName: MicroBuildOutputs
ArtifactType: Container
displayName: 'OptProf - Publish Artifact: MicroBuildOutputs'
condition: succeeded()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: logs'
inputs:
PathtoPublish: 'artifacts\log\$(BuildConfiguration)'
ArtifactName: logs
condition: succeededOrFailed()
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: symbols'
inputs:
PathtoPublish: 'artifacts\bin'
ArtifactName: symbols
condition: succeededOrFailed()
# Publishes setup VSIXes to a drop.
# Note: The insertion tool looks for the display name of this task in the logs.
- task: ms-vseng.MicroBuildTasks.4305a8de-ba66-4d8b-b2d1-0dc4ecbbf5e8.MicroBuildUploadVstsDropFolder@1
displayName: Upload VSTS Drop
inputs:
DropName: $(VisualStudio.DropName)
DropFolder: 'artifacts\VSSetup\$(BuildConfiguration)\Insertion'
condition: succeeded()
# Publish an artifact that the RoslynInsertionTool is able to find by its name.
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: VSSetup'
inputs:
PathtoPublish: 'artifacts\VSSetup\$(BuildConfiguration)'
ArtifactName: VSSetup
condition: succeeded()
# Archive NuGet packages to DevOps.
# Publish our NuPkgs as an artifact. The name of this artifact must be PackageArtifacts as the
# arcade templates depend on the name.
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: packages'
inputs:
PathtoPublish: 'artifacts\packages\$(BuildConfiguration)'
ArtifactName: PackageArtifacts
condition: succeeded()
# Publish Asset Manifests for Build Asset Registry job
- task: PublishBuildArtifacts@1
displayName: Publish Asset Manifests
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(BuildConfiguration)/AssetManifest'
ArtifactName: AssetManifests
condition: succeeded()
# Tag the build at the very end when we know it's been successful.
- task: colinsalmcorner.colinsalmcorner-buildtasks.tag-build-task.tagBuildOrRelease@0
displayName: Tag build as ready for optimization training
inputs:
tags: 'ready-for-training'
condition: succeeded()
- task: ms-vseng.MicroBuildTasks.521a94ea-9e68-468a-8167-6dcf361ea776.MicroBuildCleanup@1
displayName: Execute cleanup tasks
condition: succeededOrFailed()
- template: /eng/common/templates/job/publish-build-assets.yml
parameters:
enablePublishBuildArtifacts: true
publishUsingPipelines: true
dependsOn:
- Windows_NT
pool:
vmImage: vs2017-win2016
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng\common\templates\post-build\post-build.yml
parameters:
# 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
enableNugetValidation: false