forked from microsoft/PTVS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
338 lines (298 loc) · 11.2 KB
/
azure-pipelines.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
# This pipeline is used to build the PTVS product and installer.
# A seperate release pipeline is used to create insertion PR's into Visual Studio.
# build number format
name: $(date:yy)$(DayOfYear)$(rev:.r)
# Trigger ci builds for commits into master and any release branches
# Ignore the policy.yml file, since that's a different pipeline
trigger:
branches:
include:
- main
- release/*
paths:
exclude:
- 'azure-pipelines-policy.yml'
# Trigger pr builds for commits into master and any release branches
# Ignore the policy.yml file, since that's a different pipeline
# Also ignore draft PR's
pr:
branches:
include:
- main
- release/*
paths:
exclude:
- 'azure-pipelines-policy.yml'
drafts: false
# The agent pool the build will run on
pool:
name: VSEngSS-MicroBuild2019-1ES
demands:
- msbuild
- VisualStudio_16.0
# Build variables
# None of these are settable at build queue time. To do that, remove the variable from this list,
# browse to the pipeline editor in AzDO, add the variable there, and make it settable at queue time.
variables:
- name: DropRoot
value: \\cpvsbuild\Drops\DSTools\PTVS\$(Build.SourceBranchName)\$(Build.BuildNumber)\
- name: FileVersionPrefix
value: 17.0
- name: IncludeDjangoHtmlExtensions
value: true
- name: IncludeMiniconda
value: true
- name: IncludeMSI
value: false
- name: IncludeUWP
value: false
- name: TrackFileAccess
value: false
- name: VSTarget_Override
value: 17.0
# PTVS variable group
# This contains variables shared between the PTVS "product" pipeline and the PTVS "policy" pipeline.
# It also contains an AzDO Personal Access Token (ArtifactServices.Symbol.PAT) that expires on 8/19/2022
# which is used to publish symbols to symweb.
# If Visual Studio insertion PRs start failing the Symbol Check step, this token is most likely expired.
# See https://www.1eswiki.com/wiki/Using_Azure_DevOps_Symbols for more information about how to create a new
# PAT and how to update the variable group.
# Variable group is defined here: https://devdiv.visualstudio.com/DevDiv/_library?itemType=VariableGroups&view=VariableGroupView&variableGroupId=334&path=PTVS
- group: PTVS
steps:
# check out code clean from source control
- checkout: self
clean: true
# skip some steps if this is a PR build
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
# add build tag
- powershell: 'Write-Host "##vso[build.addbuildtag]$env:VSTarget"'
displayName: 'Add vstarget build tag'
# install plugins needed for swixproj/vsmanproj, signing, and localization
- task: MicroBuildSwixPlugin@3
displayName: 'Install microbuild swix plugin'
inputs:
dropName: 'Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)'
- task: MicroBuildSigningPlugin@3
displayName: 'Install microbuild signing plugin'
inputs:
signType: 'Real'
zipSources: false
- task: MicroBuildLocalizationPlugin@3
displayName: 'Install localization plugin'
inputs:
type: 'Full'
languages: 'VS'
# Print out queued
- powershell: 'dir env:'
displayName: 'List out environment'
# Update our .npmrc file to point to the feed for pylance
# AZURE_DEVOPS_TOKEN is the base64 encoded access token. See here to create it:
# https://devdiv.visualstudio.com/DevDiv/_packaging?_a=connect&feed=Pylance
# https://devdiv.visualstudio.com/_details/security/tokens
- task: PowerShell@1
env:
MAPPED_AZURE_DEVOPS_TOKEN: $(AZURE_DEVOPS_TOKEN)
MAPPED_AZURE_DEVOPS_USERNAME: $(AZURE_DEVOPS_USERNAME)
displayName: 'Update .npmrc to find pylance feed'
inputs:
scriptName: Build/UpdateNpmrc.ps1
# Print out npmrc
- powershell: 'Get-Content ".npmrc"'
displayName: 'Dump npmrc'
# Run npm ci to install pylance
- powershell: 'npm install --verbose'
condition: notin(variables['Build.Reason'], 'PullRequest')
displayName: 'Install pylance with npm'
# Clean old packages
- task: DeleteFiles@1
displayName: 'Clean old packages'
inputs:
SourceFolder: 'packages'
Contents: '**'
continueOnError: true
# Run a powershell script that does a package restore, some symlinking, and installs debugpy
- task: PowerShell@1
displayName: 'Restore packages'
inputs:
scriptName: Build/PreBuild.ps1
arguments: '-vstarget $(VSTarget_Override)'
# Clean the old swix outputs
- task: DeleteFiles@1
displayName: 'Clean old swix outputs'
inputs:
SourceFolder: '$(Build.BinariesDirectory)\raw\setup\swix'
Contents: '**'
continueOnError: true
# Build the product
- task: MSBuild@1
displayName: 'Build product'
inputs:
solution: Python/Product/dirs.proj
msbuildVersion: $(MsBuildVersion)
platform: $(Platform)
configuration: $(BuildConfiguration)
msbuildArguments: '/p:VSTarget=$(VSTarget_Override) /bl:$(Build.SourcesDirectory)\logs\BuildProduct.binlog'
# Build the tests
- task: MSBuild@1
displayName: 'Build tests'
inputs:
solution: Python/Tests/dirs.proj
msbuildVersion: $(MsBuildVersion)
platform: $(Platform)
configuration: $(BuildConfiguration)
msbuildArguments: '/p:VSTarget=$(VSTarget_Override) /bl:$(Build.SourcesDirectory)\logs\BuildTests.binlog'
# Build the installer
- task: MSBuild@1
displayName: 'Build installer'
inputs:
solution: Python/Setup/dirs.proj
msbuildVersion: $(MsBuildVersion)
platform: $(Platform)
configuration: $(BuildConfiguration)
msbuildArguments: '/p:SkipProduct=true /p:VSTarget=$(VSTarget_Override) /bl:$(Build.SourcesDirectory)\logs\BuildInstaller.binlog'
# Publish buld artifact: raw
- task: PublishBuildArtifacts@1
displayName: '[If build failed] Publish raw build artifact'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)\raw'
ArtifactName: raw
condition: failed()
# Publish build logs
- task: PublishBuildArtifacts@1
displayName: 'Publish Build Logs'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)\logs'
ArtifactName: Logs
condition: succeededOrFailed()
# Upload vsts drop
- task: MicroBuildUploadVstsDropFolder@1
displayName: 'Upload vsts drop'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
DropFolder: '$(Build.StagingDirectory)\release'
DropServiceUri: 'https://devdiv.artifacts.visualstudio.com/DefaultCollection'
VSDropServiceUri: 'https://vsdrop.corp.microsoft.com/file/v1'
AccessToken: '$(System.AccessToken)'
continueOnError: true
# copy some files around to prepare for publishing build artifacts
- task: CopyFiles@2
displayName: 'Copy source to staging/src'
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
TargetFolder: '$(Build.ArtifactStagingDirectory)/src'
CleanTargetFolder: true
- task: CopyFiles@2
displayName: 'Copy layout to staging'
inputs:
SourceFolder: '$(Build.BinariesDirectory)/layout'
TargetFolder: '$(Build.ArtifactStagingDirectory)/layout'
CleanTargetFolder: true
- task: CopyFiles@2
displayName: 'Copy binaries to staging'
inputs:
SourceFolder: '$(Build.BinariesDirectory)/raw/binaries'
TargetFolder: '$(Build.ArtifactStagingDirectory)/binaries'
CleanTargetFolder: true
- task: CopyFiles@2
displayName: 'Copy swix to staging'
inputs:
SourceFolder: '$(Build.BinariesDirectory)/raw/setup'
TargetFolder: '$(Build.ArtifactStagingDirectory)/setup'
CleanTargetFolder: true
- task: CopyFiles@2
displayName: 'Prepare for symbol publishing'
inputs:
SourceFolder: '$(Build.ArtifactStagingDirectory)/binaries'
Contents: |
Microsoft.PythonTools*.pdb
Microsoft.PythonTools*.dll
Microsoft.PythonTools*.exe
Microsoft.CookiecutterTools.pdb
Microsoft.CookiecutterTools.dll
Microsoft.IronPythonTools.Resolver.pdb
Microsoft.IronPythonTools.Resolver.dll
Microsoft.Python.Analysis.Engine.dll
Microsoft.Python.Analysis.Engine.pdb
Microsoft.Python.LanguageServer.Core.dll
Microsoft.Python.LanguageServer.Core.pdb
Microsoft.Python.Parsing.dll
Microsoft.Python.Parsing.pdb
Microsoft.Python.Core.dll
Microsoft.Python.Core.pdb
PyDebugAttach*.pdb
PyDebugAttach*.dll
VsPyProf*.pdb
VsPyProf*.dll
TargetFolder: '$(Build.ArtifactStagingDirectory)/symbols_and_binaries'
# Index sources and publish symbols if not a pull request
- task: PublishSymbols@2
displayName: 'Publish symbols'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
symbolsFolder: '$(Build.ArtifactStagingDirectory)/symbols_and_binaries'
searchPattern: '*.pdb'
symbolServerType: TeamServices
# Create bootstrapper for running integration tests. They only run on CI, not PR
- task: MicroBuildBuildVSBootstrapper@2
displayName: 'Build Bootstrapper.json'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
channelName: 'int.main'
vsMajorVersion: '17'
bootstrapperCoreFeedSource: 'https://devdiv.pkgs.visualstudio.com/_packaging/Setup/nuget/v3/index.json'
bootstrapperCoreDependenciesFeedSource: 'https://devdiv.pkgs.visualstudio.com/_packaging/Setup-Dependencies/nuget/v3/index.json'
nugetOrgPublicFeedSource: 'https://api.nuget.org/v3/index.json'
outputFolder: $(Build.BinariesDirectory)/raw/binaries
manifests: $(Build.StagingDirectory)\release\Microsoft.PythonTools.vsman
# MicroBuild cleanup
- task: MicroBuildCleanup@1
displayName: 'Execute cleanup tasks'
condition: succeededOrFailed()
# Compress staging output
- task: ArchiveFiles@2
displayName: 'Compress staging dir'
condition: notin(variables['Build.Reason'], 'PullRequest')
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/PTVSBuildArchive.zip'
replaceExistingArchive: true
# Compress just the test data
# Used in this release task to run tests: https://devdiv.visualstudio.com/DevDiv/_taskgroup/a7b18468-aab5-4be7-b718-02f85b0828c4
- task: ArchiveFiles@2
displayName: 'Compress test data dir'
inputs:
rootFolderOrFile: '$(Build.ArtifactStagingDirectory)/src/Python/Tests/TestData'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/TestData.zip'
replaceExistingArchive: true
# Publish build artifact: binaries
- task: PublishBuildArtifacts@1
displayName: 'Upload binaries to build artifacts'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)/raw/binaries'
ArtifactName: Binaries
# Publish build artifact: staging output
- task: PublishBuildArtifacts@1
condition: notin(variables['Build.Reason'], 'PullRequest')
displayName: 'Upload staging zip to build artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/PTVSBuildArchive.zip'
ArtifactName: 'PTVS Staging Output'
# Publish test data archive (so we don't have to pull down everything to run tests)
- task: PublishBuildArtifacts@1
displayName: 'Upload test data zip to build artifacts'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/TestData.zip'
ArtifactName: 'TestData'
# Publish bootstrapper info
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: $(Build.StagingDirectory)\MicroBuild\Output
ArtifactName: MicroBuildOutputs
ArtifactType: Container
displayName: 'Publish Artifact: MicroBuildOutputs'
condition: succeeded()