aspnetcore-tooling/azure-pipelines.yml

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

variables:
- name: Build.Repository.Clean
value: true
- name: _TeamName
value: AspNetCore
resources:
containers:
- container: LinuxContainer
image: microsoft/dotnet-buildtools-prereqs:ubuntu-14.04-cross-0cd4667-20170319080304
2019-01-09 22:39:02 +03:00
options: --init # This ensures all the stray defunct processes are reaped.
trigger:
- master
2018-12-12 03:25:04 +03:00
- release/*
pr:
- "*"
jobs:
# This job checks for code quality
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: false
enablePublishTestResults: false
jobs:
- job: Code_check
displayName: Code check
pool:
# 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')) }}:
name: dotnet-external-vs2019-preview
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
name: dotnet-internal-vs2019-preview
steps:
- powershell: ./restore.cmd -ci; ./eng/scripts/CodeCheck.ps1 -ci
displayName: Run eng/scripts/CodeCheck.ps1
# Three jobs for each of the three OSes we want to run on
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: true
enablePublishTestResults: true
enableTelemetry: true
helixRepo: aspnet/AspNetCore-Tooling
helixType: build.product/
# 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')) }}:
enableMicrobuild: true
enablePublishBuildAssets: true
jobs:
- job: Windows
pool:
# 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')) }}:
name: dotnet-external-vs2019-preview
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
name: dotnet-internal-vs2019-preview
strategy:
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
_DotNetPublishToBlobFeed: true
_PublishArgs: /p:PublishToSymbolServer=true
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
/p:PublishToAzure=true
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=$(_PublishBlobFeedUrl)
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
variables:
- _DotNetPublishToBlobFeed : false
- _PublishBlobFeedUrl: https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json
- _PublishArgs: '/p:PublishToSymbolServer=false /p:PublishToAzure=false'
- _BuildArgs: ''
- _OfficialBuildIdArgs: ''
# Variables for internal Official builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- _SignType: real
- _BuildArgs: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(Build.BuildNumber)
/p:ManifestBuildBranch=$(Build.SourceBranchName)
/p:ManifestBuildNumber=$(Build.BuildNumber)
/p:VisualStudioDropName=Products/AspNet/AspNetCore-Tooling/$(Build.SourceBranchName)/$(Build.BuildNumber)
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-Blob-Feed
- group: DotNet-Symbol-Server-Pats
steps:
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_BuildArgs)
$(_PublishArgs)
name: Build
displayName: Build
condition: succeeded()
# Detect OSS Components in use in the product. Only needs to run on one OS in the matrix.
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: Detect components
condition: and(succeeded(), eq(variables['system.pullrequest.isfork'], false), 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 package artifacts
inputs:
PathtoPublish: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)
PublishLocation: Container
ArtifactName: Packages_$(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: eq(variables['_BuildConfig'], 'Release')
- job: macOS
pool:
name: Hosted macOS
strategy:
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
steps:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
name: Build
displayName: Build
condition: succeeded()
- job: Linux
pool:
name: Hosted Ubuntu 1604
container: LinuxContainer
strategy:
matrix:
debug:
_BuildConfig: Debug
release:
_BuildConfig: Release
steps:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
name: Build
displayName: Build
condition: succeeded()