-
Notifications
You must be signed in to change notification settings - Fork 448
/
build.yml
140 lines (126 loc) · 5.26 KB
/
build.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
parameters:
# Agent OS identifier and used as job name
agentOs: ''
# Agent pool
pool: {}
# Additional variables
variables: {}
# Build strategy - matrix
strategy: {}
# Job timeout
timeoutInMinutes: 180
phases:
- template: /eng/common/templates/job/job.yml
parameters:
name: ${{ parameters.agentOs }}
${{ if eq(parameters.agentOs, 'Windows_NT') }}:
enableMicrobuild: true
enablePublishBuildAssets: true
enableTelemetry: true
helixRepo: dotnet/core-sdk
pool: ${{ parameters.pool }}
${{ if ne(parameters.strategy, '') }}:
strategy: ${{ parameters.strategy }}
variables:
- _AgentOSName: ${{ parameters.agentOs }}
- _TeamName: Roslyn-Project-System
- _BuildArgs: ''
- _SignType: test
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Symbol-Server-PATs
- group: DotNet-HelixApi-Access
- _DotNetPublishToBlobFeed: true
- _PushToVSFeed: true
- _SignType: real
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotnetPublishSdkAssetsBlobFeedUrl=$(_PublishBlobFeedUrl)
/p:DotNetPublishSdkAssetsBlobFeedKey=$(dotnetcli-storage-key)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PB_PublishType=blob
/p:DotnetPublishChecksumsBlobFeedUrl=$(_PublishChecksumsBlobFeedUrl)
/p:DotNetPublishChecksumsBlobFeedKey=$(dotnetclichecksums-storage-key)
/p:DotNetSignType=real
/p:TeamName=$(_TeamName)
steps:
- checkout: self
clean: true
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- script: 'eng\setbuildinfo.bat $(_BuildArchitecture) $(_BuildConfig)'
displayName: Set test info (Windows)
- script: build.cmd
$(TestParameter)
-pack -publish -ci
-Configuration $(_BuildConfig)
-Architecture $(_BuildArchitecture)
$(_BuildArgs)
$(SignBuildParameters)
$(_AdditionalBuildParameters)
displayName: Build
env:
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
DropSuffix: $(_DropSuffix)
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- script: 'eng/setbuildinfo.sh $(_BuildArchitecture) $(_BuildConfig)'
displayName: Set test info (Non-Windows)
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: ./build.sh
$(TestParameter)
--pack --publish --ci
--noprettyprint
--configuration $(_BuildConfig)
$(_DockerParameter)
--architecture $(_BuildArchitecture)
$(_LinuxPortable)
$(_RuntimeIdentifier)
$(_BuildArgs)
$(_AdditionalBuildParameters)
displayName: Build
env:
DropSuffix: $(_DropSuffix)
- ${{ if or(eq(parameters.agentOs, 'Darwin'), eq(parameters.agentOs, 'FreeBSD')) }}:
- script: ./build.sh
$(TestParameter)
--pack --publish --ci
--noprettyprint
--configuration $(_BuildConfig)
$(_BuildArgs)
$(_AdditionalBuildParameters)
displayName: Build
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.agentOs, 'Windows_NT')) }}:
- task: NuGetCommand@2
displayName: Push Visual Studio NuPkgs
inputs:
command: push
packagesToPush: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/NonShipping/VS.*.nupkg'
nuGetFeedType: external
publishFeedCredentials: 'DevDiv - VS package feed'
condition: and(succeeded(), eq(variables['_PushToVSFeed'], 'true'), eq(variables['_DotNetPublishToBlobFeed'], 'true'), or(eq(variables['_BuildArchitecture'], 'x64'), eq(variables['_BuildArchitecture'], 'x86')))
- task: PublishTestResults@1
displayName: Publish Test Results
inputs:
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
platform: '$(BuildPlatform)'
configuration: '$(_BuildConfig)'
condition: not(succeeded())
- task: CopyFiles@2
displayName: Gather Logs
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts'
Contents: |
log/$(_BuildConfig)/**/*
TestResults/$(_BuildConfig)/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
continueOnError: true
condition: not(succeeded())
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
publishLocation: Container
continueOnError: true
condition: not(succeeded())