2018-10-17 22:17:40 +00:00
|
|
|
parameters:
|
2019-01-24 19:21:51 +00:00
|
|
|
# Agent OS identifier and used as job name
|
2018-10-17 22:17:40 +00:00
|
|
|
agentOs: ''
|
2019-01-24 19:21:51 +00:00
|
|
|
|
|
|
|
# Agent pool
|
|
|
|
pool: {}
|
|
|
|
|
|
|
|
# Additional variables
|
2018-10-17 22:17:40 +00:00
|
|
|
variables: {}
|
|
|
|
|
2019-01-24 19:21:51 +00:00
|
|
|
# Build strategy - matrix
|
|
|
|
strategy: {}
|
|
|
|
|
|
|
|
# Job timeout
|
|
|
|
timeoutInMinutes: 180
|
|
|
|
|
2019-09-10 19:33:20 +00:00
|
|
|
# Publish using pipelines
|
|
|
|
enablePublishUsingPipelines: true
|
|
|
|
|
2018-10-17 22:17:40 +00:00
|
|
|
phases:
|
2019-01-24 19:21:51 +00:00
|
|
|
- template: /eng/common/templates/job/job.yml
|
2018-10-17 22:17:40 +00:00
|
|
|
parameters:
|
2021-03-24 08:02:14 +00:00
|
|
|
${{ if parameters.pgoInstrument }}:
|
|
|
|
name: PGO_${{ parameters.agentOs }}
|
|
|
|
${{ if not(parameters.pgoInstrument) }}:
|
|
|
|
name: ${{ parameters.agentOs }}
|
2019-10-23 18:08:02 +00:00
|
|
|
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
|
2019-01-24 19:21:51 +00:00
|
|
|
${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
|
|
|
enableMicrobuild: true
|
|
|
|
enablePublishBuildAssets: true
|
2020-02-12 21:33:55 +00:00
|
|
|
# Don't use built-in arcade logic for publishing artifacts and test results, as we manually do this and give better names
|
|
|
|
#enablePublishBuildArtifacts: true
|
|
|
|
#enablePublishTestResults: true
|
2019-09-10 19:33:20 +00:00
|
|
|
enablePublishUsingPipelines: ${{parameters.enablePublishUsingPipelines}}
|
2018-10-17 22:17:40 +00:00
|
|
|
enableTelemetry: true
|
2020-04-27 15:53:02 +00:00
|
|
|
helixRepo: dotnet/installer
|
2019-01-24 19:21:51 +00:00
|
|
|
pool: ${{ parameters.pool }}
|
|
|
|
${{ if ne(parameters.strategy, '') }}:
|
|
|
|
strategy: ${{ parameters.strategy }}
|
2019-05-20 21:58:42 +00:00
|
|
|
workspace:
|
|
|
|
clean: all
|
2019-01-24 19:21:51 +00:00
|
|
|
|
2021-03-24 08:02:14 +00:00
|
|
|
variables:
|
|
|
|
- _PgoInstrument: ''
|
|
|
|
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
|
|
|
- _PackArg: '-pack'
|
|
|
|
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
|
|
|
|
- _PackArg: '--pack'
|
|
|
|
- ${{ if parameters.pgoInstrument }}:
|
|
|
|
- _PgoInstrument: '/p:PgoInstrument=true'
|
|
|
|
- _PackArg: ''
|
|
|
|
|
2019-04-18 06:36:12 +00:00
|
|
|
- _AgentOSName: ${{ parameters.agentOs }}
|
2019-01-24 19:21:51 +00:00
|
|
|
- _TeamName: Roslyn-Project-System
|
2019-01-26 01:39:42 +00:00
|
|
|
- _SignType: test
|
2021-03-24 08:02:14 +00:00
|
|
|
- _BuildArgs: '/p:DotNetSignType=$(_SignType) $(_PgoInstrument)'
|
2019-01-24 19:21:51 +00:00
|
|
|
|
|
|
|
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
|
|
|
- group: DotNet-Symbol-Server-PATs
|
|
|
|
- group: DotNet-HelixApi-Access
|
2019-09-10 19:33:20 +00:00
|
|
|
- group: DotNet-Blob-Feed
|
2019-01-24 19:21:51 +00:00
|
|
|
- _DotNetPublishToBlobFeed: true
|
2019-07-22 01:37:00 +00:00
|
|
|
- _PushToVSFeed: true
|
2019-01-26 01:39:42 +00:00
|
|
|
- _SignType: real
|
2019-01-24 19:21:51 +00:00
|
|
|
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
|
2020-04-27 15:53:02 +00:00
|
|
|
/p:DotNetSignType=$(_SignType)
|
2019-01-24 19:21:51 +00:00
|
|
|
/p:TeamName=$(_TeamName)
|
2019-09-10 19:33:20 +00:00
|
|
|
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
|
2021-03-24 08:02:14 +00:00
|
|
|
$(_PgoInstrument)
|
2018-10-17 22:17:40 +00:00
|
|
|
|
|
|
|
steps:
|
2019-01-24 19:21:51 +00:00
|
|
|
- checkout: self
|
|
|
|
clean: true
|
2018-10-17 22:17:40 +00:00
|
|
|
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
|
2019-12-10 17:16:42 +00:00
|
|
|
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
|
|
|
|
- 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)
|
2018-10-17 22:17:40 +00:00
|
|
|
- script: build.cmd
|
2021-03-24 08:02:14 +00:00
|
|
|
$(_TestArg) $(_PackArg)
|
|
|
|
-publish -ci -sign
|
2019-01-24 19:21:51 +00:00
|
|
|
-Configuration $(_BuildConfig)
|
|
|
|
-Architecture $(_BuildArchitecture)
|
|
|
|
$(_BuildArgs)
|
|
|
|
$(_AdditionalBuildParameters)
|
2021-08-06 20:54:33 +00:00
|
|
|
$(_InternalRuntimeDownloadArgs)
|
2018-10-17 22:17:40 +00:00
|
|
|
displayName: Build
|
|
|
|
env:
|
|
|
|
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
|
|
|
|
|
2019-01-24 19:21:51 +00:00
|
|
|
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
|
2019-12-10 17:16:42 +00:00
|
|
|
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
|
|
|
|
- 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)
|
2018-10-17 22:17:40 +00:00
|
|
|
- ${{ if eq(parameters.agentOs, 'Linux') }}:
|
|
|
|
- script: ./build.sh
|
2021-03-24 08:02:14 +00:00
|
|
|
$(_TestArg) $(_PackArg)
|
|
|
|
--publish --ci
|
2018-11-08 07:20:01 +00:00
|
|
|
--noprettyprint
|
2019-01-24 19:21:51 +00:00
|
|
|
--configuration $(_BuildConfig)
|
|
|
|
$(_DockerParameter)
|
|
|
|
--architecture $(_BuildArchitecture)
|
|
|
|
$(_LinuxPortable)
|
|
|
|
$(_RuntimeIdentifier)
|
|
|
|
$(_BuildArgs)
|
|
|
|
$(_AdditionalBuildParameters)
|
2021-08-06 20:54:33 +00:00
|
|
|
$(_InternalRuntimeDownloadArgs)
|
2018-10-17 22:17:40 +00:00
|
|
|
displayName: Build
|
|
|
|
|
2018-12-28 21:13:52 +00:00
|
|
|
- ${{ if or(eq(parameters.agentOs, 'Darwin'), eq(parameters.agentOs, 'FreeBSD')) }}:
|
2018-10-17 22:17:40 +00:00
|
|
|
- script: ./build.sh
|
2020-04-27 15:53:02 +00:00
|
|
|
$(_TestArg)
|
2018-12-20 21:52:32 +00:00
|
|
|
--pack --publish --ci
|
2018-11-08 07:20:01 +00:00
|
|
|
--noprettyprint
|
2019-01-24 19:21:51 +00:00
|
|
|
--configuration $(_BuildConfig)
|
2020-11-18 20:12:39 +00:00
|
|
|
--architecture $(_BuildArchitecture)
|
|
|
|
$(_RuntimeIdentifier)
|
2019-01-24 19:21:51 +00:00
|
|
|
$(_BuildArgs)
|
|
|
|
$(_AdditionalBuildParameters)
|
2021-08-06 20:54:33 +00:00
|
|
|
$(_InternalRuntimeDownloadArgs)
|
2018-10-17 22:17:40 +00:00
|
|
|
displayName: Build
|
|
|
|
|
2020-09-11 17:58:51 +00:00
|
|
|
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(parameters.agentOs, 'Windows_NT'), ne(variables['PostBuildSign'], 'true')) }}:
|
2019-07-22 01:37:00 +00:00
|
|
|
- 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'
|
2021-04-09 18:34:12 +00:00
|
|
|
condition: and(succeeded(), ne(variables['PostBuildSign'], true), eq(variables['_PushToVSFeed'], 'true'), eq(variables['_DotNetPublishToBlobFeed'], 'true'), or(eq(variables['_BuildArchitecture'], 'x64'), eq(variables['_BuildArchitecture'], 'x86')))
|
2019-07-22 01:37:00 +00:00
|
|
|
|
2021-03-24 08:02:14 +00:00
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: Publish Test Results
|
2019-07-02 23:34:59 +00:00
|
|
|
inputs:
|
2021-03-24 08:02:14 +00:00
|
|
|
testRunner: XUnit
|
|
|
|
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
|
|
|
|
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
|
|
|
|
platform: '$(BuildPlatform)'
|
|
|
|
configuration: '$(_BuildConfig)'
|
2020-04-27 15:53:02 +00:00
|
|
|
condition: ne(variables['_TestArg'], '')
|
2019-04-18 06:36:12 +00:00
|
|
|
|
2021-03-24 08:02:14 +00:00
|
|
|
- task: CopyFiles@2
|
|
|
|
displayName: Gather Logs
|
2019-07-02 23:34:59 +00:00
|
|
|
inputs:
|
2021-03-24 08:02:14 +00:00
|
|
|
SourceFolder: '$(Build.SourcesDirectory)/artifacts'
|
|
|
|
Contents: |
|
|
|
|
log/$(_BuildConfig)/**/*
|
|
|
|
TestResults/$(_BuildConfig)/**/*
|
|
|
|
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
continueOnError: true
|
2019-05-19 04:59:29 +00:00
|
|
|
condition: always()
|
2019-04-18 06:36:12 +00:00
|
|
|
|
2021-03-24 08:02:14 +00:00
|
|
|
- task: PublishBuildArtifacts@1
|
|
|
|
displayName: Publish Logs to VSTS
|
2019-07-02 23:34:59 +00:00
|
|
|
inputs:
|
2021-03-24 08:02:14 +00:00
|
|
|
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
|
|
|
|
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
|
|
|
|
publishLocation: Container
|
|
|
|
continueOnError: true
|
2019-05-19 04:59:29 +00:00
|
|
|
condition: always()
|