Update azure-pipeline.yml to use 1ES templates (#317)
This commit is contained in:
Родитель
6d7ce48e38
Коммит
7ae564f939
|
@ -1,15 +1,3 @@
|
|||
# Branches that trigger builds on PR
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
- release/*
|
||||
paths:
|
||||
exclude:
|
||||
- README.md
|
||||
- docs/*
|
||||
|
||||
# Run official build every day at midnight, if code has changed since the last run.
|
||||
trigger:
|
||||
batch: true
|
||||
branches:
|
||||
|
@ -17,109 +5,126 @@ trigger:
|
|||
- main
|
||||
|
||||
variables:
|
||||
- template: /eng/common/templates/variables/pool-providers.yml
|
||||
- name: _TeamName
|
||||
value: Roslyn
|
||||
- template: /eng/common/templates-official/variables/pool-providers.yml@self
|
||||
- name: TeamName
|
||||
value: Roslyn
|
||||
|
||||
stages:
|
||||
- stage: build
|
||||
displayName: Build
|
||||
jobs:
|
||||
- template: /eng/common/templates/jobs/jobs.yml
|
||||
parameters:
|
||||
enableMicrobuild: true
|
||||
enablePublishBuildArtifacts: true
|
||||
enablePublishTestResults: true
|
||||
enablePublishBuildAssets: true
|
||||
enablePublishUsingPipelines: true
|
||||
enableTelemetry: true
|
||||
enableSourceBuild: true
|
||||
helixRepo: dotnet/symreader
|
||||
resources:
|
||||
repositories:
|
||||
- repository: MicroBuildTemplate
|
||||
type: git
|
||||
name: 1ESPipelineTemplates/MicroBuildTemplate
|
||||
ref: refs/tags/release
|
||||
extends:
|
||||
template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
|
||||
parameters:
|
||||
sdl:
|
||||
sourceAnalysisPool:
|
||||
name: $(DncEngInternalBuildPool)
|
||||
image: 1es-windows-2022-pt
|
||||
os: windows
|
||||
pool:
|
||||
name: AzurePipelines-EO
|
||||
image: AzurePipelinesWindows2022compliantGPT
|
||||
os: windows
|
||||
customBuildTags:
|
||||
- ES365AIMigrationTooling
|
||||
stages:
|
||||
- stage: build
|
||||
displayName: Build
|
||||
jobs:
|
||||
- job: Windows
|
||||
pool:
|
||||
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
vmImage: 'windows-latest'
|
||||
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
name: $(DncEngInternalBuildPool)
|
||||
demands: ImageOverride -equals 1es-windows-2022
|
||||
variables:
|
||||
# Only enable publishing in official builds
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
|
||||
- group: Publish-Build-Assets
|
||||
- name: _OfficialBuildArgs
|
||||
value: /p:DotNetSignType=$(_SignType)
|
||||
/p:TeamName=$(_TeamName)
|
||||
/p:DotNetPublishUsingPipelines=true
|
||||
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
|
||||
# else
|
||||
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- name: _OfficialBuildArgs
|
||||
value: ''
|
||||
strategy:
|
||||
matrix:
|
||||
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
Debug:
|
||||
_BuildConfig: Debug
|
||||
_SignType: test
|
||||
_BuildArgs: ''
|
||||
Release:
|
||||
_BuildConfig: Release
|
||||
# PRs or external builds are not signed.
|
||||
- template: /eng/common/templates-official/jobs/jobs.yml@self
|
||||
parameters:
|
||||
enableMicrobuild: true
|
||||
enablePublishBuildArtifacts: true
|
||||
enablePublishTestResults: true
|
||||
enablePublishBuildAssets: true
|
||||
enablePublishUsingPipelines: true
|
||||
enableTelemetry: true
|
||||
enableSourceBuild: true
|
||||
helixRepo: dotnet/symreader
|
||||
jobs:
|
||||
- job: Windows
|
||||
pool:
|
||||
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
_SignType: test
|
||||
_BuildArgs: ''
|
||||
vmImage: 'windows-latest'
|
||||
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
_SignType: real
|
||||
_BuildArgs: $(_OfficialBuildArgs)
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_BuildArgs)
|
||||
displayName: Build and Test
|
||||
name: $(DncEngInternalBuildPool)
|
||||
demands: ImageOverride -equals 1es-windows-2022
|
||||
variables:
|
||||
# Only enable publishing in official builds
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
# Publish-Build-Assets provides: MaestroAccessToken, BotAccount-dotnet-maestro-bot-PAT
|
||||
- group: Publish-Build-Assets
|
||||
- name: _OfficialBuildArgs
|
||||
value: /p:DotNetSignType=$(_SignType)
|
||||
/p:TeamName=$(TeamName)
|
||||
/p:DotNetPublishUsingPipelines=true
|
||||
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
|
||||
# else
|
||||
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- name: _OfficialBuildArgs
|
||||
value: ''
|
||||
strategy:
|
||||
matrix:
|
||||
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
Debug:
|
||||
_BuildConfig: Debug
|
||||
_SignType: test
|
||||
_BuildArgs: ''
|
||||
Release:
|
||||
_BuildConfig: Release
|
||||
# PRs or external builds are not signed.
|
||||
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
_SignType: test
|
||||
_BuildArgs: ''
|
||||
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
_SignType: real
|
||||
_BuildArgs: $(_OfficialBuildArgs)
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: eng\common\cibuild.cmd -configuration $(_BuildConfig) -prepareMachine $(_BuildArgs)
|
||||
displayName: Build and Test
|
||||
|
||||
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- job: MacOS
|
||||
displayName: 'MacOS'
|
||||
pool:
|
||||
vmImage: 'macOS-latest'
|
||||
strategy:
|
||||
matrix:
|
||||
Debug:
|
||||
_BuildConfig: Debug
|
||||
_SignType: none
|
||||
Release:
|
||||
_BuildConfig: Release
|
||||
_SignType: none
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: eng/common/cibuild.sh --configuration $(_BuildConfig) --prepareMachine
|
||||
displayName: Build and Test
|
||||
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- job: MacOS
|
||||
displayName: 'MacOS'
|
||||
pool:
|
||||
vmImage: 'macOS-latest'
|
||||
strategy:
|
||||
matrix:
|
||||
Debug:
|
||||
_BuildConfig: Debug
|
||||
_SignType: none
|
||||
Release:
|
||||
_BuildConfig: Release
|
||||
_SignType: none
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: eng/common/cibuild.sh --configuration $(_BuildConfig) --prepareMachine
|
||||
displayName: Build and Test
|
||||
|
||||
- job: Linux
|
||||
displayName: 'Linux'
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
strategy:
|
||||
matrix:
|
||||
Debug:
|
||||
_BuildConfig: Debug
|
||||
_SignType: none
|
||||
Release:
|
||||
_BuildConfig: Release
|
||||
_SignType: none
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: eng/common/cibuild.sh --configuration $(_BuildConfig) --prepareMachine
|
||||
displayName: Build and Test
|
||||
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- template: eng\common\templates\post-build\post-build.yml
|
||||
parameters:
|
||||
publishingInfraVersion: 3
|
||||
# Symbol validation isn't being very reliable lately. This should be enabled back
|
||||
# once this issue is resolved: https://github.com/dotnet/arcade/issues/2871
|
||||
enableSymbolValidation: false
|
||||
- job: Linux
|
||||
displayName: 'Linux'
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
strategy:
|
||||
matrix:
|
||||
Debug:
|
||||
_BuildConfig: Debug
|
||||
_SignType: none
|
||||
Release:
|
||||
_BuildConfig: Release
|
||||
_SignType: none
|
||||
steps:
|
||||
- checkout: self
|
||||
clean: true
|
||||
- script: eng/common/cibuild.sh --configuration $(_BuildConfig) --prepareMachine
|
||||
displayName: Build and Test
|
||||
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
|
||||
- template: /eng/common/templates-official/post-build/post-build.yml@self
|
||||
parameters:
|
||||
publishingInfraVersion: 3
|
||||
enableSymbolValidation: false
|
||||
|
|
Загрузка…
Ссылка в новой задаче