dotnet-installer/eng/build.yml

161 lines
6.1 KiB
YAML
Raw Normal View History

2018-10-17 22:17:40 +00:00
parameters:
# Agent OS identifier and used as job name
2018-10-17 22:17:40 +00:00
agentOs: ''
# Agent pool
pool: {}
# Additional variables
2018-10-17 22:17:40 +00:00
variables: {}
# Build strategy - matrix
strategy: {}
# Job timeout
timeoutInMinutes: 180
# Publish using pipelines
enablePublishUsingPipelines: true
2018-10-17 22:17:40 +00:00
phases:
- template: /eng/common/templates/job/job.yml
2018-10-17 22:17:40 +00:00
parameters:
name: ${{ parameters.agentOs }}
2019-10-23 00:45:06 +00:00
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
${{ if eq(parameters.agentOs, 'Windows_NT') }}:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishBuildAssets: true
enablePublishTestResults: true
enablePublishUsingPipelines: ${{parameters.enablePublishUsingPipelines}}
2018-10-17 22:17:40 +00:00
enableTelemetry: true
helixRepo: dotnet/core-sdk
pool: ${{ parameters.pool }}
${{ if ne(parameters.strategy, '') }}:
strategy: ${{ parameters.strategy }}
2019-05-20 21:58:42 +00:00
workspace:
clean: all
2018-10-17 22:17:40 +00:00
variables:
- _AgentOSName: ${{ parameters.agentOs }}
- _TeamName: Roslyn-Project-System
- _BuildArgs: ''
- _SignType: test
- _DOTNETCLIMSRC_READ_SAS_TOKEN: ''
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), contains(variables['Build.SourceBranch'], 'internal')) }}:
- group: DotNet-MSRC-Storage
- _DOTNETCLIMSRC_READ_SAS_TOKEN: $(dotnetclimsrc-read-sas-token)
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Symbol-Server-PATs
- group: DotNet-HelixApi-Access
- group: DotNet-Blob-Feed
- _DotNetPublishToBlobFeed: true
- _PushToVSFeed: true
- _SignType: real
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=$(PB_PublishBlobFeedUrl)
/p:DotnetPublishSdkAssetsBlobFeedUrl=$(_PublishBlobFeedUrl)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PB_PublishType=blob
/p:DotnetPublishChecksumsBlobFeedUrl=$(_PublishChecksumsBlobFeedUrl)
/p:DotNetSignType=real
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
2018-10-17 22:17:40 +00:00
steps:
- checkout: self
clean: true
2018-10-17 22:17:40 +00:00
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- script: 'eng\setbuildinfo.bat $(_BuildArchitecture) $(_BuildConfig)'
displayName: Set test info (Windows)
2018-10-17 22:17:40 +00:00
- script: build.cmd
2018-11-28 02:48:13 +00:00
$(TestParameter)
-pack -publish -ci
-Configuration $(_BuildConfig)
-Architecture $(_BuildArchitecture)
$(_BuildArgs)
$(SignBuildParameters)
$(_AdditionalBuildParameters)
2018-10-17 22:17:40 +00:00
displayName: Build
env:
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
DropSuffix: $(_DropSuffix)
DOTNETCLIMSRC_READ_SAS_TOKEN: $(_DOTNETCLIMSRC_READ_SAS_TOKEN)
2018-10-17 22:17:40 +00:00
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- script: 'eng/setbuildinfo.sh $(_BuildArchitecture) $(_BuildConfig)'
displayName: Set test info (Non-Windows)
2018-10-17 22:17:40 +00:00
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: ./build.sh
2018-11-28 02:48:13 +00:00
$(TestParameter)
--pack --publish --ci
--noprettyprint
--configuration $(_BuildConfig)
$(_DockerParameter)
--architecture $(_BuildArchitecture)
$(_LinuxPortable)
$(_RuntimeIdentifier)
$(_BuildArgs)
$(_AdditionalBuildParameters)
2018-10-17 22:17:40 +00:00
displayName: Build
env:
DropSuffix: $(_DropSuffix)
DOTNETCLIMSRC_READ_SAS_TOKEN: $(_DOTNETCLIMSRC_READ_SAS_TOKEN)
2018-10-17 22:17:40 +00:00
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
2018-11-28 02:48:13 +00:00
$(TestParameter)
--pack --publish --ci
--noprettyprint
--configuration $(_BuildConfig)
$(_BuildArgs)
$(_AdditionalBuildParameters)
2018-10-17 22:17:40 +00:00
displayName: Build
env:
DOTNETCLIMSRC_READ_SAS_TOKEN: $(_DOTNETCLIMSRC_READ_SAS_TOKEN)
2018-10-17 22:17:40 +00:00
- ${{ 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
2019-07-02 23:34:59 +00:00
inputs:
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
platform: '$(BuildPlatform)'
configuration: '$(_BuildConfig)'
condition: ne(variables['TestParameter'], '')
- task: CopyFiles@2
displayName: Gather Logs
2019-07-02 23:34:59 +00:00
inputs:
SourceFolder: '$(Build.SourcesDirectory)/artifacts'
Contents: |
log/$(_BuildConfig)/**/*
TestResults/$(_BuildConfig)/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
continueOnError: true
2019-05-19 04:59:29 +00:00
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
2019-07-02 23:34:59 +00:00
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
publishLocation: Container
continueOnError: true
2019-05-19 04:59:29 +00:00
condition: always()