aspnetcore-tooling/azure-pipelines-compiler.yml

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

#
# See https://docs.microsoft.com/en-us/vsts/pipelines/yaml-schema for details on this file.
#
2021-11-22 22:25:37 +03:00
trigger:
batch: true
branches:
include:
- main
- release/*
- internal/release/*
2021-11-22 22:25:37 +03:00
pr:
autoCancel: true
branches:
include:
- "*"
parameters:
# Choose whether to skip tests when running pipeline manually.
- name: skipTests
default: false
displayName: Skip tests?
type: boolean
# Choose whether to test source indexing. Ignored in public builds.
# Will cause inaccessible links on https://source.dot.net/ unless commits are also available in GitHub.
- name: testSourceIndexing
default: false
displayName: Test source indexing? !Danger! see comments in YAML.
type: boolean
variables:
- name: Build.Repository.Clean
value: true
- name: _TeamName
value: AspNetCore
- name: DOTNET_CLI_TELEMETRY_PROFILE
value: '$(Build.Repository.Uri)'
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: _DotNetArtifactsCategory
value: .NETCore
- name: _DotNetPublishToBlobFeed
value: true
- name: _PublishUsingPipelines
value: true
- name: PostBuildSign
value: false
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
- name: _SignType
value: ''
- name: _BuildArgs
value: /p:PostBuildSign=$(PostBuildSign)
- name: _PublishArgs
value: ''
- ${{ if ne(variables['System.TeamProject'], 'public') }}:
# DotNet-MSRC-Storage provides: dotnetclimsrc-read-sas-token-base64
- group: DotNet-MSRC-Storage
- name: _InternalBuildArgs
value: -RuntimeSourceFeed https://dotnetclimsrc.blob.core.windows.net/dotnet
-RuntimeSourceFeedKey $(dotnetclimsrc-read-sas-token-base64)
/p:DotNetAssetRootAccessTokenSuffix='$(dotnetclimsrc-read-sas-token-base64)'
/p:DotNetRuntimeSourceFeed=https://dotnetclimsrc.blob.core.windows.net/dotnet
/p:DotNetRuntimeSourceFeedKey=$(dotnetclimsrc-read-sas-token-base64)
/p:PostBuildSign=$(PostBuildSign)
- ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
# DotNet-Blob-Feed provides: dotnetfeed-storage-access-key-1
- group: DotNet-Blob-Feed
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
- group: Publish-Build-Assets
- name: _SignType
value: real
- name: _BuildArgs
value: $(_InternalBuildArgs)
/p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(Build.BuildNumber)
- name: _PublishArgs
value: /p:Publish=true
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotNetPublishBlobFeedKey=$(dotnetfeed-storage-access-key-1)
/p:DotNetPublishBlobFeedUrl=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:DotNetPublishToBlobFeed=$(_DotNetPublishToBlobFeed)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetSignType=$(_SignType)
- ${{ if in(variables['Build.Reason'], 'PullRequest') }}:
- name: _SignType
value: test
- name: _BuildArgs
value: $(_InternalBuildArgs)
/p:PostBuildSign=$(PostBuildSign)
- name: _PublishArgs
value: ''
2021-11-22 22:25:37 +03:00
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enablePublishBuildArtifacts: true
enablePublishBuildAssets: true
enablePublishTestResults: true
2021-11-22 22:25:37 +03:00
enablePublishUsingPipelines: true
enableSourceBuild: true
enableTelemetry: true
mergeTestResults: true
testResultsFormat: xUnit # Have no vsTest results in any job.
workspace:
clean: all
${{ if and(ne(variables['System.TeamProject'], 'public'), or(eq(parameters.testSourceIndexing, 'true'), eq(variables['Build.SourceBranch'], 'refs/heads/main'))) }}:
enableSourceIndex: true
sourceIndexParams:
dependsOn:
- Windows
- Source_Build_Complete
pool:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019
2021-11-22 22:25:37 +03:00
jobs:
- job: Windows
enableMicrobuild: true
2021-11-22 22:25:37 +03:00
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: NetCore1ESPool-Public
demands: ImageOverride -equals Build.Server.Amd64.VS2019.Open
${{ if ne(variables['System.TeamProject'], 'public') }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Server.Amd64.VS2019
strategy:
matrix:
${{ if in(variables['Build.Reason'], 'PullRequest') }}:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
testRunTitle: $(Agent.Os)-$(_BuildConfig)
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
2021-11-22 22:25:37 +03:00
steps:
- checkout: self
clean: true
- script: eng\common\cibuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_BuildArgs)
$(_PublishArgs)
2021-11-22 22:25:37 +03:00
name: Build
displayName: Build
condition: succeeded()
# Following somewhat duplicates BlobArtifacts and PackageArtifacts uploaded during Build step.
# But, the layout makes shipping packages (and symbol packages) immediately obvious.
2021-11-22 22:25:37 +03:00
- task: PublishBuildArtifacts@1
displayName: Publish Packages
condition: and(eq(variables['system.pullrequest.isfork'], false), eq(variables['_BuildConfig'], 'Release'))
continueOnError: true
inputs:
artifactName: Packages_$(Agent.Os)_$(Agent.JobName)
parallel: true
pathtoPublish: '$(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)'
publishLocation: Container
- ${{ if and(ne(parameters.skipTests, 'true'), or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest', 'Manual'))) }}:
- job: macOS
pool:
vmImage: macOS-latest
strategy:
matrix:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
testRunTitle: $(Agent.Os)-$(_BuildConfig)
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
steps:
- checkout: self
clean: true
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--ci --prepareMachine --restore --build --test --pack
$(_BuildArgs)
name: Build
displayName: Build
condition: succeeded()
2021-11-22 22:25:37 +03:00
- job: Linux
pool:
${{ if or(ne(variables['System.TeamProject'], 'internal'), in(variables['Build.Reason'], 'Manual', 'PullRequest', 'Schedule')) }}:
vmImage: ubuntu-latest
${{ if and(eq(variables['System.TeamProject'], 'internal'), notin(variables['Build.Reason'], 'Manual', 'PullRequest', 'Schedule')) }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
strategy:
matrix:
Debug:
_BuildConfig: Debug
Release:
_BuildConfig: Release
testRunTitle: $(Agent.Os)-$(_BuildConfig)
variables:
- LC_ALL: 'en_US.UTF-8'
- LANG: 'en_US.UTF-8'
- LANGUAGE: 'en_US.UTF-8'
steps:
- checkout: self
clean: true
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--ci --prepareMachine --restore --build --test --pack
$(_BuildArgs)
name: Build
displayName: Build
condition: succeeded()
2021-11-22 22:25:37 +03:00
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng\common\templates\post-build\post-build.yml
parameters:
publishingInfraVersion: 3
enableSymbolValidation: false
enableNugetValidation: false