razor-tooling/azure-pipelines.yml

189 строки
6.8 KiB
YAML
Исходник Обычный вид История

variables:
Build.Repository.Clean: true
_TeamName: DotNetCore
# Variables for public PR builds
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.DefinitionName'], 'github')) }}:
_HelixType: build/product
_HelixSource: pr/aspnet/AspNetCore-Tooling/$(Build.SourceBranch)
# These are needed to suppress a warning in the cibuild invocation since AzDO leaves the `$(_SignArgs)` in place and it fails to resolve.
_SignArgs: ''
_OfficialBuildIdArgs: ''
2018-12-02 04:56:38 +03:00
_PublishArgs: ''
# Variables for internal Official builds
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.DefinitionName'], 'official')) }}:
_HelixType: build/product
_HelixSource: official/aspnet/AspNetCore-Tooling/$(Build.SourceBranch)
_SignType: test
_SignArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
_OfficialBuildIdArgs: /p:OfficialBuildId=$(Build.BuildNumber)
2018-12-02 04:56:38 +03:00
_PublishArgs: '/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat) /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)'
resources:
containers:
- container: LinuxContainer
image: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-0cd4667-20170319080304
trigger:
- master
pr:
- "*"
# Three phases for each of the three OSes we want to run on
phases:
- template: /eng/common/templates/phases/base.yml
parameters:
name: Windows
enableTelemetry: true
# enableMicrobuild can't be read from a user-defined variable (Azure DevOps limitation)
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.DefinitionName'], 'official')) }}:
enableMicrobuild: true
queue:
# agent pool can't be read from a user-defined variable (Azure DevOps limitation)
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.DefinitionName'], 'github')) }}:
name: dotnet-external-temp
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), contains(variables['Build.DefinitionName'], 'official')) }}:
name: dotnet-internal-temp
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
steps:
# workaround for dotnet/arcade#1425 (revert to cibuild.cmd once fixed)
- script: eng\build-no-publish.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_SignArgs)
$(_OfficialBuildIdArgs)
2018-12-02 04:56:38 +03:00
$(_PublishArgs)
name: Build
displayName: Build
condition: succeeded()
- task: PublishTestResults@2
displayName: Publish xUnit Test Results
condition: always()
continueOnError: true
inputs:
testRunner: xunit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
# workaround for dotnet/arcade#1425 (remove once fixed)
- script: eng\publish.cmd
-configuration $(_BuildConfig)
-msbuildEngine dotnet
$(_SignArgs)
$(_OfficialBuildIdArgs)
$(_PublishArgs)
name: Publish
displayName: Publish
condition: succeeded()
- task: PublishBuildArtifacts@1
displayName: Publish Packages
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: Packages_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: eq(variables['_BuildConfig'], 'Release')
- task: PublishBuildArtifacts@1
displayName: Publish VSIX Artifacts
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/VSSetup/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: VSIX_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: eq(variables['_BuildConfig'], 'Release')
- task: PublishBuildArtifacts@1
displayName: Publish VS for Mac Artifacts
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/MPack/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: MPack_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: eq(variables['_BuildConfig'], 'Release')
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: Logs_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: always()
variables:
_HelixBuildConfig: $(_BuildConfig)
- template: /eng/common/templates/phases/base.yml
parameters:
name: macOS
enableTelemetry: true
queue:
name: Hosted macOS
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
steps:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
name: Build
displayName: Build
condition: succeeded()
- task: PublishTestResults@2
displayName: Publish xUnit Test Results
condition: always()
continueOnError: true
inputs:
testRunner: xunit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: Logs_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: always()
variables:
_HelixBuildConfig: $(_BuildConfig)
- template: /eng/common/templates/phases/base.yml
parameters:
name: Linux
enableTelemetry: true
queue:
name: Hosted Ubuntu 1604
container: LinuxContainer
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
steps:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
name: Build
displayName: Build
condition: succeeded()
- task: PublishTestResults@2
displayName: Publish xUnit Test Results
condition: always()
continueOnError: true
inputs:
testRunner: xunit
testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
- task: PublishBuildArtifacts@1
displayName: Publish Logs
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)'
PublishLocation: Container
ArtifactName: Logs_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: always()
variables:
_HelixBuildConfig: $(_BuildConfig)