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
|
parameters:
buildConfig: ''
osGroup: ''
archType: ''
osSubgroup: ''
crossrootfsDir: ''
framework: 'net5.0'
isOfficialAllConfigurations: false
isSourceBuild: false
liveRuntimeBuildConfig: ''
runtimeFlavor: 'coreclr'
timeoutInMinutes: 150
condition: true
container: ''
steps: []
dependsOn: []
dependOnEvaluatePaths: false
variables: {}
name: ''
displayName: ''
testDisplayName: ''
testScope: ''
pool: ''
runTests: false
jobs:
- template: /eng/common/templates/job/job.yml
parameters:
${{ if notIn(parameters.framework, 'allConfigurations', 'net48') }}:
displayName: ${{ format('Libraries {0} {1}{2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
name: ${{ format('libraries_{0}_{1}{2}_{3}_{4}', parameters.name, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
${{ if in(parameters.framework, 'allConfigurations', 'net48') }}:
displayName: ${{ format('Libraries {0} {1} {2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }}
name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.name, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
enableTelemetry: ${{ parameters.isOfficialBuild }} # TODO: figure out if it's needed
container: ${{ parameters.container }}
condition: and(succeeded(), ${{ parameters.condition }})
helixRepo: dotnet/runtime
pool: ${{ parameters.pool }}
variables:
- _buildScriptFileName: build
- _msbuildCommonParameters: ''
# rename this variable, due to collision with build-native.proj
- _runtimeOSArg: ''
- _finalFrameworkArg: ''
- _testModeArg: ''
- _buildScript: $(_buildScriptFileName)$(scriptExt)
- _testScopeArg: ''
- _extraHelixArguments: ''
- _crossBuildPropertyArg: ''
- _testRunNamePrefixSuffix: ''
- librariesBuildArtifactName: ${{ format('libraries_bin_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if ne(parameters.testScope, '') }}:
- _testScopeArg: -testscope ${{ parameters.testScope }}
- ${{ if in(parameters.osGroup, 'Linux', 'FreeBSD') }}:
- _crossBuildPropertyArg: /p:CrossBuild=${{ ne(parameters.crossrootfsDir, '') }}
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, '_musl')) }}:
- _runtimeOSArg: /p:RuntimeOS=linux-musl
- ${{ if and(eq(parameters.osGroup, 'Linux'), eq(parameters.osSubGroup, ''), eq(parameters.archType, 'arm')) }}:
- _runtimeOSArg: /p:RuntimeOS=ubuntu.16.04
# force a value for OS when cross-building
- ${{ if in(parameters.osGroup, 'Browser', 'iOS', 'tvOS', 'Android', 'FreeBSD') }}:
- _runtimeOSArg: -os ${{ parameters.osGroup }}
- ${{ if ne(parameters.framework, '') }}:
- _finalFrameworkArg: -framework ${{ parameters.framework }}
- _extraHelixArguments: /p:BuildTargetFramework=${{ parameters.framework }}
- ${{ if eq(parameters.framework, 'allConfigurations') }}:
- _finalFrameworkArg: -allConfigurations
- _testModeArg: /p:TestAssemblies=false /p:TestPackages=true
- _extraHelixArguments: /p:TestPackages=true
- ${{ if eq(parameters.isOfficialAllConfigurations, true) }}:
- librariesBuildArtifactName: 'libraries_bin_official_allconfigurations'
- ${{ if eq(parameters.isOfficialBuild, 'true') }}:
- _msbuildCommonParameters: /p:OfficialBuildId=$(Build.BuildNumber)
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- group: AzureDevOps-Artifact-Feeds-Pats
- _runtimeArtifactName: ''
- _runtimeDownloadPath: ''
- _runtimeArtifactsPathArg: ''
- _runtimeConfigurationArg: ''
- ${{ if ne(parameters.liveRuntimeBuildConfig, '') }}:
- _runtimeDownloadPath: '$(Build.SourcesDirectory)/artifacts/transport/${{ parameters.runtimeFlavor }}'
- _runtimeConfigurationArg: -rc ${{ parameters.liveRuntimeBuildConfig }}
- ${{ if eq(parameters.runTests, true) }}:
- _runtimeArtifactName: '$(runtimeFlavorName)Product_${{ parameters.runtimeVariant}}_${{ parameters.osGroup }}${{ parameters.osSubgroup }}_${{ parameters.archType }}_${{ parameters.liveRuntimeBuildConfig }}'
- _runtimeArtifactsPathArg: ' /p:RuntimeArtifactsPath=$(_runtimeDownloadPath)'
- ${{ if eq(parameters.testDisplayName, '') }}:
- _testRunNamePrefixSuffix: $(runtimeFlavorName)_${{ parameters.liveRuntimeBuildConfig }}
- ${{ if ne(parameters.testDisplayName, '') }}:
- _testRunNamePrefixSuffix: ${{ parameters.testDisplayName }}
# Windows variables
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- _runtimeOSArg: /p:RuntimeOS=win10
# Non-Windows variables
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- _buildScript: ./$(_buildScriptFileName)$(scriptExt)
- _buildArguments: $(_runtimeConfigurationArg) -configuration ${{ parameters.buildConfig }} -ci -arch ${{ parameters.archType }} $(_finalFrameworkArg) $(_testModeArg) $(_testScopeArg) $(_runtimeOSArg) $(_msbuildCommonParameters) $(_runtimeArtifactsPathArg) $(_crossBuildPropertyArg)
- ${{ parameters.variables }}
# we need to override this value to support build-coreclr-and-libraries-job.yml
- _BuildConfig: ${{ parameters.buildConfig }}
dependsOn:
- ${{ if eq(parameters.dependOnEvaluatePaths, true) }}:
- evaluate_paths
- ${{ parameters.dependsOn }}
workspace:
clean: all
enablePublishBuildArtifacts: true
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
steps:
- checkout: self
clean: true
fetchDepth: $(checkoutFetchDepth)
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- ${{ if ne(parameters.osGroup, 'Windows_NT') }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.sh
arguments: $(Build.SourcesDirectory)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- ${{ if eq(parameters.osGroup, 'Windows_NT') }}:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(Build.SourcesDirectory)\eng\common\SetupNugetSources.ps1
arguments: -ConfigFile $(Build.SourcesDirectory)\NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- ${{ if and(ne(parameters.liveRuntimeBuildConfig, ''), eq(parameters.runTests, true)) }}:
- template: /eng/pipelines/common/download-artifact-step.yml
parameters:
unpackFolder: $(_runtimeDownloadPath)
artifactFileName: '$(_runtimeArtifactName)$(archiveExtension)'
artifactName: '$(_runtimeArtifactName)'
displayName: '$(runtimeFlavorName) build drop'
- ${{ parameters.steps }}
|