forked from dotnet/razor-compiler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
224 lines (216 loc) · 7.68 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
#
# See https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema for details on this file.
#
trigger:
batch: true
branches:
include:
- main
- release/*
- internal/release/*
pr:
autoCancel: true
branches:
include:
- "*"
parameters:
# Choose whether to skip tests when running pipeline manually.
- name: skipTests
default: false
displayName: Skip tests?
type: boolean
# Choose whether to test source indexing. Ignored in public builds.
# Will cause inaccessible links on https://source.dot.net/ unless commits are also available in GitHub.
- name: testSourceIndexing
default: false
displayName: Test source indexing? !Danger! see comments in YAML.
type: boolean
variables:
- name: Build.Repository.Clean
value: true
- name: _TeamName
value: AspNetCore
- name: DOTNET_CLI_TELEMETRY_PROFILE
value: '$(Build.Repository.Uri)'
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
- name: _DotNetPublishToBlobFeed
value: true
- name: _PublishUsingPipelines
value: true
- name: PostBuildSign
value: true
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- name: _SignType
value: ''
- name: _BuildArgs
value: /p:PostBuildSign=$(PostBuildSign)
- name: _PublishArgs
value: ''
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
# DotNet-MSRC-Storage provides: dotnetclimsrc-read-sas-token-base64
- group: DotNet-MSRC-Storage
- name: _InternalBuildArgs
value: -RuntimeSourceFeed https://dotnetclimsrc.blob.core.windows.net/dotnet
-RuntimeSourceFeedKey $(dotnetclimsrc-read-sas-token-base64)
/p:DotNetAssetRootAccessTokenSuffix='$(dotnetclimsrc-read-sas-token-base64)'
/p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet
/p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64)
/p:PostBuildSign=$(PostBuildSign)
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
# DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
- group: DotNet-Blob-Feed
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- group: Publish-Build-Assets
- name: _SignType
value: real
- name: _BuildArgs
value: $(_InternalBuildArgs)
/p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(Build.BuildNumber)
- name: _PublishArgs
value: /p:Publish=true
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetSignType=$(_SignType)
- ${{ if in(variables['Build.Reason'], 'PullRequest') }}:
- name: _SignType
value: test
- name: _BuildArgs
value: $(_InternalBuildArgs)
/p:PostBuildSign=$(PostBuildSign)
- name: _PublishArgs
value: ''
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: true
enablePublishBuildAssets: true
enablePublishTestResults: true
enablePublishUsingPipelines: true
enableSourceBuild: true
enableTelemetry: true
mergeTestResults: true
testResultsFormat: xUnit # Have no vsTest results in any job.
workspace:
clean: all
${{ if and(ne(variables['System.TeamProject'], 'public'), or(eq(parameters.testSourceIndexing, 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}:
enableSourceIndex: true
sourceIndexParams:
dependsOn:
- Windows
- Source_Build_Complete
- ${{ if ne(parameters.skipTests, 'true') }}:
- macOS
- Linux
pool:
vmImage: windows-latest
jobs:
- job: Windows
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore1ESPool-Public
demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open
${{ if ne(variables['System.TeamProject'], 'public') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019
strategy:
matrix:
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
testRunTitle: $(Agent.Os)-$(_BuildConfig)
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
steps:
- checkout: self
clean: true
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_BuildArgs)
$(_PublishArgs)
name: Build
displayName: Build
condition: succeeded()
# Following somewhat duplicates BlobArtifacts and PackageArtifacts uploaded during Build step.
# But, the layout makes shipping packages (and symbol packages) immediately obvious.
- task: PublishBuildArtifacts@1
displayName: Publish Packages
condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
continueOnError: true
inputs:
artifactName: Packages_$(Agent.Os)_$(Agent.JobName)
parallel: true
pathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)'
publishLocation: Container
- ${{ if and(ne(parameters.skipTests, 'true'), or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest', 'Manual'))) }}:
- job: macOS
pool:
vmImage: macOS-latest
strategy:
matrix:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
testRunTitle: $(Agent.Os)-$(_BuildConfig)
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
steps:
- checkout: self
clean: true
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--ci --prepareMachine --restore --build --test --pack
$(_BuildArgs)
name: Build
displayName: Build
condition: succeeded()
- job: Linux
pool:
vmImage: ubuntu-latest
strategy:
matrix:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
testRunTitle: $(Agent.Os)-$(_BuildConfig)
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
steps:
- checkout: self
clean: true
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--ci --prepareMachine --restore --build --test --pack
$(_BuildArgs)
name: Build
displayName: Build
condition: succeeded()
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng\common\templates\post-build\post-build.yml
parameters:
publishingInfraVersion: 3
enableSymbolValidation: false
enableSigningValidation: false
enableNugetValidation: false
pool:
vmImage: windows-latest