dotnet-installer/eng/build.yml

141 lines
5.4 KiB
YAML
Raw Normal View History

2018-10-17 22:17:40 +00:00
parameters:
agentOs: ''
queue: {}
variables: {}
phases:
- template: /eng/common/templates/phases/base.yml
parameters:
name: ${{ parameters.agentOs }}
enableTelemetry: true
2018-11-07 07:40:20 +00:00
enableMicrobuild: true
2018-10-17 22:17:40 +00:00
publicBuildReasons: PullRequest
queue: ${{ parameters.queue }}
variables:
${{ insert }}: ${{ parameters.variables }}
_AgentOSName: ${{ parameters.agentOs }}
_HelixType: build/product
_HelixBuildConfig: $(_BuildConfig)
BuildConfig: $(_BuildConfig)
BuildArchitecture: $(_BuildArchitecture)
DockerParameter: $(_DockerParameter)
LinuxPortable: $(_LinuxPortable)
RuntimeId: $(_RuntimeIdentifier)
AdditionalBuildParameters: $(_AdditionalBuildParameters)
${{ if eq(variables['System.TeamProject'], 'public') }}:
_HelixSource: pr/dotnet/core-sdk/$(Build.SourceBranch)
_OfficialBuildIdArgs: ''
_PublishArgs: ''
_SignArgs: ''
${{ if ne(variables['System.TeamProject'], 'public') }}:
_HelixSource: official/dotnet/core-sdk/$(Build.SourceBranch)
_OfficialBuildIdArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
_PublishArgs: /p:DotNetPublishBlobFeedKey=$(dotnetcli-storage-key)
/p:DotNetPublishBlobFeedUrl=$(PB_PublishBlobFeedUrl)
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PB_PublishType=$(_PublishType)
_SignArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
2018-10-17 22:17:40 +00:00
steps:
2018-12-04 23:23:53 +00:00
- script: 'eng\setbuildinfo.bat $(BuildArchitecture) $(BuildConfig)'
2018-11-28 02:48:13 +00:00
condition: eq(variables['_AgentOSName'], 'Windows_NT')
displayName: Set test info (Windows)
2018-12-04 23:23:53 +00:00
- script: 'eng/setbuildinfo.sh $(BuildArchitecture) $(BuildConfig)'
2018-11-28 02:48:13 +00:00
condition: ne(variables['_AgentOSName'], 'Windows_NT')
displayName: Set test info (Non-Windows)
- script: 'echo TestParameter: $(TestParameter)'
displayName: Show TestParameter
- script: 'echo RunTests: $(RunTests)'
displayName: Show RunTests
- script: 'echo AdditionalBuildParameters: $(AdditionalBuildParameters)'
displayName: Show AdditionalBuildParameters
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
- task: AzureKeyVault@1
inputs:
azureSubscription: 'DotNet-Engineering-Services_KeyVault'
KeyVaultName: EngKeyVault
SecretsFilter: 'dotnetcli-storage-key,microsoft-symbol-server-pat,symweb-symbol-server-pat'
condition: succeeded()
- task: AzureKeyVault@1
inputs:
azureSubscription: 'HelixProd_KeyVault'
KeyVaultName: HelixProdKV
SecretsFilter: 'HelixApiAccessToken'
condition: always()
2018-10-17 22:17:40 +00:00
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- script: build.cmd
2018-11-28 02:48:13 +00:00
$(TestParameter)
-pack -publish -ci
2018-10-17 22:17:40 +00:00
-Configuration $(BuildConfig)
-Architecture $(BuildArchitecture)
$(_PublishArgs)
$(_SignArgs)
$(_OfficialBuildIdArgs)
$(AdditionalBuildParameters)
2018-10-17 22:17:40 +00:00
displayName: Build
env:
DOTNET_CLI_UI_LANGUAGE: $(_DOTNET_CLI_UI_LANGUAGE)
DropSuffix: $(_DropSuffix)
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: ./build.sh
2018-11-28 02:48:13 +00:00
$(TestParameter)
--pack --publish --ci
--noprettyprint
2018-10-17 22:17:40 +00:00
--configuration $(BuildConfig)
$(DockerParameter)
--architecture $(BuildArchitecture)
$(LinuxPortable)
$(RuntimeId)
$(_PublishArgs)
$(_SignArgs)
$(_OfficialBuildIdArgs)
$(AdditionalBuildParameters)
2018-10-17 22:17:40 +00:00
displayName: Build
env:
DropSuffix: $(_DropSuffix)
- ${{ if eq(parameters.agentOs, 'Darwin') }}:
- script: ./build.sh
2018-11-28 02:48:13 +00:00
$(TestParameter)
--pack --publish --ci
--noprettyprint
2018-10-17 22:17:40 +00:00
--configuration $(BuildConfig)
$(_PublishArgs)
$(_SignArgs)
$(_OfficialBuildIdArgs)
2018-10-17 22:17:40 +00:00
displayName: Build
- task: PublishTestResults@1
displayName: Publish Test Results
inputs:
2018-11-07 07:40:20 +00:00
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
2018-10-17 22:17:40 +00:00
platform: '$(BuildPlatform)'
configuration: '$(_BuildConfig)'
2018-11-28 02:48:13 +00:00
condition: and(succeededOrFailed(), ne(variables['PB_SkipTests'], 'true'), ne(variables['RunTests'], 'false'))
2018-10-17 22:17:40 +00:00
- task: CopyFiles@2
displayName: Gather Logs
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: |
2018-11-07 07:40:20 +00:00
artifacts/log/$(_BuildConfig)/**/*
artifacts/TestResults/$(_BuildConfig)/**/*
2018-10-17 22:17:40 +00:00
TargetFolder: '$(Build.ArtifactStagingDirectory)'
continueOnError: true
condition: always()
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
publishLocation: Container
continueOnError: true
condition: always()