Made the official CI pipeline use 1ES templates from Arcade. Created separate build-pr.yml for PR pipeline to use. Modified CI and normal build.yml to no longer have public conditional logic. Changed to using PT image for migration testing. Updated localization.yml to use the new templates.

This commit is contained in:
Michael Yanni 2024-03-08 12:38:29 -08:00
parent a246c1d7fc
commit 421270b99b
5 changed files with 550 additions and 376 deletions

View file

@ -1,3 +1,5 @@
# Pipeline: https://dnceng.visualstudio.com/internal/_build?definitionId=286
trigger: trigger:
batch: true batch: true
branches: branches:
@ -8,6 +10,7 @@ trigger:
- internal/release/* - internal/release/*
variables: variables:
# Loose Variables
- name: _PublishUsingPipelines - name: _PublishUsingPipelines
value: false value: false
- ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}: - ${{ if or(startswith(variables['Build.SourceBranch'], 'refs/heads/release/'), startswith(variables['Build.SourceBranch'], 'refs/heads/internal/release/'), eq(variables['Build.Reason'], 'Manual')) }}:
@ -23,10 +26,14 @@ variables:
- group: DotNet-Installer-SDLValidation-Params - group: DotNet-Installer-SDLValidation-Params
- name: _PublishUsingPipelines - name: _PublishUsingPipelines
value: true value: true
- name: _InternalRuntimeDownloadArgs - name: _InternalRuntimeDownloadArgs
value: '' value: ''
# Only used for tracking purposes in MicroBuild tasks.
# See: https://devdiv.visualstudio.com/DevDiv/_wiki/wikis/DevDiv.wiki/650/MicroBuild-Signing?anchor=high-level-steps-to-enable-signing
- name: TeamName
value: DotNetCLI
# Variable Groups
- ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ if eq(variables['System.TeamProject'], 'internal') }}:
- group: DotNetBuilds storage account read tokens - group: DotNetBuilds storage account read tokens
- name: _InternalRuntimeDownloadArgs - name: _InternalRuntimeDownloadArgs
@ -34,328 +41,241 @@ variables:
/p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64) /p:DotNetRuntimeSourceFeedKey=$(dotnetbuilds-internal-container-read-token-base64)
/p:dotnetbuilds-internal-container-read-token-base64=$(dotnetbuilds-internal-container-read-token-base64) /p:dotnetbuilds-internal-container-read-token-base64=$(dotnetbuilds-internal-container-read-token-base64)
- template: /eng/common/templates/variables/pool-providers.yml # Variable Templates
- template: /eng/common/templates-official/variables/pool-providers.yml
stages: resources:
- stage: Build repositories:
jobs: - repository: MicroBuildTemplate
# This job is for build retry configuration. type: git
- job: Publish_Build_Configuration name: 1ESPipelineTemplates/MicroBuildTemplate
pool: ref: refs/tags/release
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool) extends:
demands: ImageOverride -equals windows.vs2022preview.amd64.open template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate
${{ if eq(variables['System.TeamProject'], 'internal') }}: parameters:
sdl:
sourceAnalysisPool:
name: $(DncEngInternalBuildPool) name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64 image: 1es-windows-2022-pt
steps: os: windows
- publish: $(Build.SourcesDirectory)\eng\buildConfiguration customBuildTags:
artifact: buildConfiguration - ES365AIMigrationTooling
displayName: Publish Build Config stages:
- stage: Build
## PR-only jobs jobs:
# Build Retry Configuration
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - job: Publish_Build_Configuration
## Windows
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Debug_x64
buildConfiguration: Debug
buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: true
## Linux
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Ubuntu_22_04_Debug_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04'
buildConfiguration: Debug
buildArchitecture: x64
linuxPortable: true
runTests: true
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Fedora_39_Debug_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39'
buildConfiguration: Debug
buildArchitecture: x64
linuxPortable: true
runTests: true
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_CentOS_8_Stream_Debug_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
buildConfiguration: Debug
buildArchitecture: x64
linuxPortable: false
runTests: true
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Debian_11_Debug_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:debian-11-amd64'
buildConfiguration: Debug
buildArchitecture: x64
additionalBuildParameters: '/p:BuildSdkDeb=true'
linuxPortable: false
runTests: true
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Arm64_Debug
buildConfiguration: Debug
buildArchitecture: arm64
runtimeIdentifier: 'linux-arm64'
linuxPortable: true
# Never run tests on arm64
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Debug_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode'
buildConfiguration: Debug
buildArchitecture: x64
runtimeIdentifier: 'linux-musl-x64'
# Pass in HostOSName when running on alpine
additionalBuildParameters: '/p:HostOSName="linux-musl"'
linuxPortable: false
runTests: true
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_LinuxPortable_Release_x64
buildConfiguration: Release
buildArchitecture: x64
linuxPortable: true
runTests: true
# MacOS
- template: eng/build.yml
parameters:
agentOs: Darwin
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
runTests: true
## Official/PGO instrumentation Builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
## Windows
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Release_x86
buildConfiguration: Release
buildArchitecture: x86
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
runTests: false
## Linux
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Arm_Release
buildConfiguration: Release
buildArchitecture: arm
runtimeIdentifier: 'linux-arm'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Arm64_Release
buildConfiguration: Release
buildArchitecture: arm64
runtimeIdentifier: 'linux-arm64'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Release_arm
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine'
buildConfiguration: Release
buildArchitecture: arm
runtimeIdentifier: 'linux-musl-arm'
additionalBuildParameters: '/p:OSName="linux-musl"'
linuxPortable: false
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
runtimeIdentifier: 'linux-musl-arm64'
additionalBuildParameters: '/p:OSName="linux-musl"'
linuxPortable: false
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Release_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode'
buildConfiguration: Release
buildArchitecture: x64
runtimeIdentifier: 'linux-musl-x64'
# Pass in HostOSName when running on alpine
additionalBuildParameters: '/p:HostOSName="linux-musl"'
linuxPortable: false
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_Portable_Deb_Release_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg'
buildConfiguration: Release
buildArchitecture: x64
# Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:BuildSdkDeb=true'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_Portable_Rpm_Release_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-fpm'
buildConfiguration: Release
buildArchitecture: x64
# Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:IsRPMBasedDistro=true'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_Portable_Rpm_Release_Arm64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-fpm'
buildConfiguration: Release
buildArchitecture: arm64
runtimeIdentifier: 'linux-arm64'
# Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:CLIBUILD_SKIP_TESTS=true /p:IsRPMBasedDistro=true'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_LinuxPortable_Release_x64
buildConfiguration: Release
buildArchitecture: x64
linuxPortable: true
runTests: false
# MacOS
- template: eng/build.yml
parameters:
agentOs: Darwin
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
runTests: false
- template: eng/build.yml
parameters:
agentOs: Darwin
jobName: Build_Release_arm64
runtimeIdentifier: 'osx-arm64'
buildConfiguration: Release
buildArchitecture: arm64
runTests: false
## Windows PGO Instrumentation builds
- template: eng/build.yml
parameters:
agentOs: Windows_NT
pgoInstrument: true
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
pgoInstrument: true
jobName: Build_Release_x86
buildConfiguration: Release
buildArchitecture: x86
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
pgoInstrument: true
jobName: Build_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
runTests: false
## Linux PGO Instrumentation builds
- template: eng/build.yml
parameters:
agentOs: Linux
pgoInstrument: true
jobName: Build_LinuxPortable_Release_x64
buildConfiguration: Release
buildArchitecture: x64
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
pgoInstrument: true
jobName: Build_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
linuxPortable: true
runTests: false
- template: /eng/common/templates/jobs/source-build.yml
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- stage: Publish
dependsOn:
- Build
jobs:
- template: /eng/common/templates/job/publish-build-assets.yml
parameters:
publishUsingPipelines: true
publishAssetsImmediately: true
pool: pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022preview.amd64.open
${{ if eq(variables['System.TeamProject'], 'internal') }}: ${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool) name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64 demands: ImageOverride -equals windows.vs2022preview.amd64
steps:
- publish: $(Build.SourcesDirectory)\eng\buildConfiguration
artifact: buildConfiguration
displayName: Publish Build Config
# Windows
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Release_x86
buildConfiguration: Release
buildArchitecture: x86
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
jobName: Build_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
runTests: false
# Linux
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Arm_Release
buildConfiguration: Release
buildArchitecture: arm
runtimeIdentifier: 'linux-arm'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Arm64_Release
buildConfiguration: Release
buildArchitecture: arm64
runtimeIdentifier: 'linux-arm64'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Release_arm
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-cross-arm-alpine'
buildConfiguration: Release
buildArchitecture: arm
runtimeIdentifier: 'linux-musl-arm'
additionalBuildParameters: '/p:OSName="linux-musl"'
linuxPortable: false
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
runtimeIdentifier: 'linux-musl-arm64'
additionalBuildParameters: '/p:OSName="linux-musl"'
linuxPortable: false
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_musl_Release_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode'
buildConfiguration: Release
buildArchitecture: x64
runtimeIdentifier: 'linux-musl-x64'
# Pass in HostOSName when running on alpine
additionalBuildParameters: '/p:HostOSName="linux-musl"'
linuxPortable: false
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_Portable_Deb_Release_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-debpkg'
buildConfiguration: Release
buildArchitecture: x64
# Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:BuildSdkDeb=true'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_Portable_Rpm_Release_x64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-fpm'
buildConfiguration: Release
buildArchitecture: x64
# Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:IsRPMBasedDistro=true'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_Linux_Portable_Rpm_Release_Arm64
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-fpm'
buildConfiguration: Release
buildArchitecture: arm64
runtimeIdentifier: 'linux-arm64'
# Do not publish zips and tarballs. The linux-x64 binaries are
# already published by Build_LinuxPortable_Release_x64
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:CLIBUILD_SKIP_TESTS=true /p:IsRPMBasedDistro=true'
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
jobName: Build_LinuxPortable_Release_x64
buildConfiguration: Release
buildArchitecture: x64
linuxPortable: true
runTests: false
# MacOS
- template: eng/build.yml
parameters:
agentOs: Darwin
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
runTests: false
- template: eng/build.yml
parameters:
agentOs: Darwin
jobName: Build_Release_arm64
runtimeIdentifier: 'osx-arm64'
buildConfiguration: Release
buildArchitecture: arm64
runTests: false
# Windows PGO Instrumentation
- template: eng/build.yml
parameters:
agentOs: Windows_NT
pgoInstrument: true
jobName: Build_Release_x64
buildConfiguration: Release
buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
pgoInstrument: true
jobName: Build_Release_x86
buildConfiguration: Release
buildArchitecture: x86
runTests: false
- template: eng/build.yml
parameters:
agentOs: Windows_NT
pgoInstrument: true
jobName: Build_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
runTests: false
# Linux PGO Instrumentation
- template: eng/build.yml
parameters:
agentOs: Linux
pgoInstrument: true
jobName: Build_LinuxPortable_Release_x64
buildConfiguration: Release
buildArchitecture: x64
linuxPortable: true
runTests: false
- template: eng/build.yml
parameters:
agentOs: Linux
pgoInstrument: true
jobName: Build_Release_arm64
buildConfiguration: Release
buildArchitecture: arm64
linuxPortable: true
runTests: false
# Source Build
- template: /eng/common/templates-official/jobs/source-build.yml
- stage: Publish
dependsOn:
- Build
jobs:
- template: /eng/common/templates-official/job/publish-build-assets.yml
parameters:
publishUsingPipelines: true
publishAssetsImmediately: true
pool:
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64

View file

@ -1,3 +1,5 @@
# Pipeline: https://dev.azure.com/dnceng-public/public/_build?definitionId=20
trigger: trigger:
batch: true batch: true
branches: branches:
@ -59,7 +61,7 @@ stages:
## Windows ## Windows
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
jobName: Build_Debug_x64 jobName: Build_Debug_x64
@ -70,7 +72,7 @@ stages:
## Linux ## Linux
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Ubuntu_22_04_Debug_x64 jobName: Build_Ubuntu_22_04_Debug_x64
@ -79,7 +81,7 @@ stages:
buildArchitecture: x64 buildArchitecture: x64
linuxPortable: true linuxPortable: true
runTests: true runTests: true
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Fedora_39_Debug_x64 jobName: Build_Fedora_39_Debug_x64
@ -88,7 +90,7 @@ stages:
buildArchitecture: x64 buildArchitecture: x64
linuxPortable: true linuxPortable: true
runTests: true runTests: true
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_CentOS_8_Stream_Debug_x64 jobName: Build_CentOS_8_Stream_Debug_x64
@ -97,7 +99,7 @@ stages:
buildArchitecture: x64 buildArchitecture: x64
linuxPortable: false linuxPortable: false
runTests: true runTests: true
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Debian_11_Debug_x64 jobName: Build_Debian_11_Debug_x64
@ -107,7 +109,7 @@ stages:
additionalBuildParameters: '/p:BuildSdkDeb=true' additionalBuildParameters: '/p:BuildSdkDeb=true'
linuxPortable: false linuxPortable: false
runTests: true runTests: true
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Arm64_Debug jobName: Build_Arm64_Debug
@ -117,7 +119,7 @@ stages:
linuxPortable: true linuxPortable: true
# Never run tests on arm64 # Never run tests on arm64
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_musl_Debug_x64 jobName: Build_Linux_musl_Debug_x64
@ -129,7 +131,7 @@ stages:
additionalBuildParameters: '/p:HostOSName="linux-musl"' additionalBuildParameters: '/p:HostOSName="linux-musl"'
linuxPortable: false linuxPortable: false
runTests: true runTests: true
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_LinuxPortable_Release_x64 jobName: Build_LinuxPortable_Release_x64
@ -140,7 +142,7 @@ stages:
# MacOS # MacOS
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Darwin agentOs: Darwin
jobName: Build_Release_x64 jobName: Build_Release_x64
@ -154,7 +156,7 @@ stages:
## Windows ## Windows
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
jobName: Build_Release_x64 jobName: Build_Release_x64
@ -162,14 +164,14 @@ stages:
buildArchitecture: x64 buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true' additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
jobName: Build_Release_x86 jobName: Build_Release_x86
buildConfiguration: Release buildConfiguration: Release
buildArchitecture: x86 buildArchitecture: x86
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
jobName: Build_Release_arm64 jobName: Build_Release_arm64
@ -179,7 +181,7 @@ stages:
## Linux ## Linux
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Arm_Release jobName: Build_Arm_Release
@ -188,7 +190,7 @@ stages:
runtimeIdentifier: 'linux-arm' runtimeIdentifier: 'linux-arm'
linuxPortable: true linuxPortable: true
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Arm64_Release jobName: Build_Arm64_Release
@ -197,7 +199,7 @@ stages:
runtimeIdentifier: 'linux-arm64' runtimeIdentifier: 'linux-arm64'
linuxPortable: true linuxPortable: true
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_musl_Release_arm jobName: Build_Linux_musl_Release_arm
@ -208,7 +210,7 @@ stages:
additionalBuildParameters: '/p:OSName="linux-musl"' additionalBuildParameters: '/p:OSName="linux-musl"'
linuxPortable: false linuxPortable: false
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_musl_Release_arm64 jobName: Build_Linux_musl_Release_arm64
@ -218,7 +220,7 @@ stages:
additionalBuildParameters: '/p:OSName="linux-musl"' additionalBuildParameters: '/p:OSName="linux-musl"'
linuxPortable: false linuxPortable: false
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_musl_Release_x64 jobName: Build_Linux_musl_Release_x64
@ -230,7 +232,7 @@ stages:
additionalBuildParameters: '/p:HostOSName="linux-musl"' additionalBuildParameters: '/p:HostOSName="linux-musl"'
linuxPortable: false linuxPortable: false
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_Portable_Deb_Release_x64 jobName: Build_Linux_Portable_Deb_Release_x64
@ -242,7 +244,7 @@ stages:
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:BuildSdkDeb=true' additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:BuildSdkDeb=true'
linuxPortable: true linuxPortable: true
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_Portable_Rpm_Release_x64 jobName: Build_Linux_Portable_Rpm_Release_x64
@ -254,7 +256,7 @@ stages:
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:IsRPMBasedDistro=true' additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:IsRPMBasedDistro=true'
linuxPortable: true linuxPortable: true
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_Linux_Portable_Rpm_Release_Arm64 jobName: Build_Linux_Portable_Rpm_Release_Arm64
@ -267,7 +269,7 @@ stages:
additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:CLIBUILD_SKIP_TESTS=true /p:IsRPMBasedDistro=true' additionalBuildParameters: '/p:PublishBinariesAndBadge=false /p:CLIBUILD_SKIP_TESTS=true /p:IsRPMBasedDistro=true'
linuxPortable: true linuxPortable: true
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
jobName: Build_LinuxPortable_Release_x64 jobName: Build_LinuxPortable_Release_x64
@ -278,14 +280,14 @@ stages:
# MacOS # MacOS
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Darwin agentOs: Darwin
jobName: Build_Release_x64 jobName: Build_Release_x64
buildConfiguration: Release buildConfiguration: Release
buildArchitecture: x64 buildArchitecture: x64
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Darwin agentOs: Darwin
jobName: Build_Release_arm64 jobName: Build_Release_arm64
@ -296,7 +298,7 @@ stages:
## Windows PGO Instrumentation builds ## Windows PGO Instrumentation builds
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
pgoInstrument: true pgoInstrument: true
@ -305,7 +307,7 @@ stages:
buildArchitecture: x64 buildArchitecture: x64
additionalBuildParameters: '/p:PublishInternalAsset=true' additionalBuildParameters: '/p:PublishInternalAsset=true'
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
pgoInstrument: true pgoInstrument: true
@ -313,7 +315,7 @@ stages:
buildConfiguration: Release buildConfiguration: Release
buildArchitecture: x86 buildArchitecture: x86
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Windows_NT agentOs: Windows_NT
pgoInstrument: true pgoInstrument: true
@ -324,7 +326,7 @@ stages:
## Linux PGO Instrumentation builds ## Linux PGO Instrumentation builds
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
pgoInstrument: true pgoInstrument: true
@ -334,7 +336,7 @@ stages:
linuxPortable: true linuxPortable: true
runTests: false runTests: false
- template: eng/build.yml - template: eng/build-pr.yml
parameters: parameters:
agentOs: Linux agentOs: Linux
pgoInstrument: true pgoInstrument: true

261
eng/build-pr.yml Normal file
View file

@ -0,0 +1,261 @@
parameters:
# Agent OS identifier and used as job name
- name: agentOs
type: string
# Job name
- name: jobName
type: string
# Container to run the build in, if any
- name: container
type: string
default: ''
# Job timeout
- name: timeoutInMinutes
type: number
default: 180
# Build configuration (Debug, Release)
- name: buildConfiguration
type: string
values:
- Debug
- Release
# Build architecture
- name: buildArchitecture
type: string
values:
- arm
- arm64
- x64
- x86
# Linux portable. If true, passes portable switch to build
- name: linuxPortable
type: boolean
default: false
# Runtime Identifier
- name: runtimeIdentifier
type: string
default: ''
# UI lang
- name: dotnetCLIUILanguage
type: string
default: ''
# Additional parameters
- name: additionalBuildParameters
type: string
default: ''
# Run tests
- name: runTests
type: boolean
default: true
# PGO instrumentation jobs
- name: pgoInstrument
type: boolean
default: false
- name: isBuiltFromVmr
displayName: True when build is running from dotnet/dotnet
type: boolean
default: false
jobs:
- template: common/templates/job/job.yml
parameters:
# Set up the name of the job.
${{ if parameters.pgoInstrument }}:
name: PGO_${{ parameters.agentOs }}_${{ parameters.jobName }}
${{ if not(parameters.pgoInstrument) }}:
name: ${{ parameters.agentOs }}_${{ parameters.jobName }}
## Set up the pool/machine info to be used based on the Agent OS
${{ if eq(parameters.agentOs, 'Windows_NT') }}:
enableMicrobuild: true
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64.open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64
${{ if eq(parameters.agentOs, 'Linux') }}:
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
name: $(DncEngPublicBuildPool)
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
container: ${{ parameters.container }}
${{ if eq(parameters.agentOs, 'Darwin') }}:
pool:
vmImage: 'macOS-latest'
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
${{ if parameters.isBuiltFromVmr }}:
enableSbom: false
${{ else }}:
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enableTelemetry: true
helixRepo: dotnet/installer
workspace:
clean: all
# Test parameters
variables:
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '-pack'
- ${{ if parameters.runTests }}:
- _TestArg: '-test'
- ${{ else }}:
- _TestArg: ''
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '--pack'
- ${{ if parameters.runTests }}:
- _TestArg: '--test'
- ${{ else }}:
- _TestArg: ''
- ${{ if parameters.pgoInstrument }}:
- _PgoInstrument: '/p:PgoInstrument=true'
- _PackArg: ''
- ${{ else }}:
- _PgoInstrument: ''
- ${{ if parameters.linuxPortable }}:
- _LinuxPortable: '--linux-portable'
- ${{ else }}:
- _LinuxPortable: ''
- ${{ if ne(parameters.runtimeIdentifier, '') }}:
- _RuntimeIdentifier: '--runtime-id ${{ parameters.runtimeIdentifier }}'
- ${{ else }}:
- _RuntimeIdentifier: ''
- _AgentOSName: ${{ parameters.agentOs }}
- _TeamName: Roslyn-Project-System
- _SignType: test
- _BuildArgs: '/p:DotNetSignType=$(_SignType) $(_PgoInstrument)'
- ${{ if parameters.isBuiltFromVmr }}:
- installerRoot: '$(Build.SourcesDirectory)/src/installer'
- _SignType: test
- _PushToVSFeed: false
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=true
/p:PublishToSymbolServer=false
$(_PgoInstrument)
- ${{ else }}:
- installerRoot: '$(Build.SourcesDirectory)'
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-HelixApi-Access
- _PushToVSFeed: true
- _SignType: real
- _BuildArgs: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
/p:DotNetSignType=$(_SignType)
/p:TeamName=$(_TeamName)
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
$(_PgoInstrument)
- template: /eng/common/templates/variables/pool-providers.yml
steps:
- checkout: self
clean: true
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- ${{ if and(not(parameters.isBuiltFromVmr), ne(variables['System.TeamProject'], 'public')) }}:
- task: PowerShell@2
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(installerRoot)/eng/common/SetupNugetSources.ps1
arguments: -ConfigFile $(installerRoot)/NuGet.config -Password $Env:Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- script: $(installerRoot)/build.cmd
$(_TestArg) $(_PackArg)
-publish -ci -sign
-Configuration ${{ parameters.buildConfiguration }}
-Architecture ${{ parameters.buildArchitecture }}
$(_BuildArgs)
${{ parameters.additionalBuildParameters }}
$(_InternalRuntimeDownloadArgs)
displayName: Build
env:
DOTNET_CLI_UI_LANGUAGE: ${{ parameters.dotnetCLIUILanguage }}
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- ${{ if and(not(parameters.isBuiltFromVmr), ne(variables['System.TeamProject'], 'public')) }}:
- task: Bash@3
displayName: Setup Private Feeds Credentials
inputs:
filePath: $(installerRoot)/eng/common/SetupNugetSources.sh
arguments: $(installerRoot)/NuGet.config $Token
env:
Token: $(dn-bot-dnceng-artifact-feeds-rw)
- ${{ if eq(parameters.agentOs, 'Linux') }}:
- script: $(installerRoot)/build.sh
$(_TestArg) $(_PackArg)
--publish --ci
--noprettyprint
--configuration ${{ parameters.buildConfiguration }}
--architecture ${{ parameters.buildArchitecture }}
$(_LinuxPortable)
$(_RuntimeIdentifier)
$(_BuildArgs)
${{ parameters.additionalBuildParameters }}
$(_InternalRuntimeDownloadArgs)
displayName: Build
- ${{ if or(eq(parameters.agentOs, 'Darwin'), eq(parameters.agentOs, 'FreeBSD')) }}:
- script: $(installerRoot)/build.sh
$(_TestArg)
--pack --publish --ci
--noprettyprint
--configuration ${{ parameters.buildConfiguration }}
--architecture ${{ parameters.buildArchitecture }}
$(_RuntimeIdentifier)
$(_BuildArgs)
${{ parameters.additionalBuildParameters }}
$(_InternalRuntimeDownloadArgs)
displayName: Build
- task: PublishTestResults@2
displayName: Publish Test Results
inputs:
testRunner: XUnit
testResultsFiles: 'artifacts/TestResults/${{ parameters.buildConfiguration }}/*.xml'
testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
platform: '$(BuildPlatform)'
configuration: '${{ parameters.buildConfiguration }}'
condition: ne(variables['_TestArg'], '')
- task: CopyFiles@2
displayName: Gather Logs
inputs:
SourceFolder: '$(installerRoot)/artifacts'
Contents: |
log/${{ parameters.buildConfiguration }}/**/*
TestResults/${{ parameters.buildConfiguration }}/**/*
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()

View file

@ -1,9 +1,9 @@
parameters: parameters:
# Agent OS identifier and used as job name # Agent OS identifier and used as job name
- name: agentOs - name: agentOs
type: string type: string
# Job name # Job name
- name: jobName - name: jobName
type: string type: string
@ -12,7 +12,7 @@ parameters:
type: string type: string
default: '' default: ''
# Job timeout # Job timeout
- name: timeoutInMinutes - name: timeoutInMinutes
type: number type: number
default: 180 default: 180
@ -32,7 +32,7 @@ parameters:
- arm64 - arm64
- x64 - x64
- x86 - x86
# Linux portable. If true, passes portable switch to build # Linux portable. If true, passes portable switch to build
- name: linuxPortable - name: linuxPortable
type: boolean type: boolean
@ -69,7 +69,7 @@ parameters:
default: false default: false
jobs: jobs:
- template: common/templates/job/job.yml - template: common/templates-official/job/job.yml
parameters: parameters:
# Set up the name of the job. # Set up the name of the job.
${{ if parameters.pgoInstrument }}: ${{ if parameters.pgoInstrument }}:
@ -77,24 +77,17 @@ jobs:
${{ if not(parameters.pgoInstrument) }}: ${{ if not(parameters.pgoInstrument) }}:
name: ${{ parameters.agentOs }}_${{ parameters.jobName }} name: ${{ parameters.agentOs }}_${{ parameters.jobName }}
## Set up the pool/machine info to be used based on the Agent OS # Set up the pool/machine info to be used based on the Agent OS
${{ if eq(parameters.agentOs, 'Windows_NT') }}: ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
enableMicrobuild: true enableMicrobuild: true
pool: pool:
${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngInternalBuildPool)
name: $(DncEngPublicBuildPool) image: 1es-windows-2022-pt
demands: ImageOverride -equals windows.vs2022.amd64.open os: windows
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals windows.vs2022.amd64
${{ if eq(parameters.agentOs, 'Linux') }}: ${{ if eq(parameters.agentOs, 'Linux') }}:
pool: pool:
${{ if eq(variables['System.TeamProject'], 'public') }}: name: $(DncEngInternalBuildPool)
name: $(DncEngPublicBuildPool) demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
${{ if eq(variables['System.TeamProject'], 'internal') }}:
name: $(DncEngInternalBuildPool)
demands: ImageOverride -equals Build.Ubuntu.1804.Amd64
container: ${{ parameters.container }} container: ${{ parameters.container }}
${{ if eq(parameters.agentOs, 'Darwin') }}: ${{ if eq(parameters.agentOs, 'Darwin') }}:
pool: pool:
@ -111,8 +104,8 @@ jobs:
workspace: workspace:
clean: all clean: all
# Test parameters
variables: variables:
# Test variables
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}: - ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- _PackArg: '-pack' - _PackArg: '-pack'
- ${{ if parameters.runTests }}: - ${{ if parameters.runTests }}:
@ -158,7 +151,7 @@ jobs:
$(_PgoInstrument) $(_PgoInstrument)
- ${{ else }}: - ${{ else }}:
- installerRoot: '$(Build.SourcesDirectory)' - installerRoot: '$(Build.SourcesDirectory)'
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - ${{ if notin(variables['Build.Reason'], 'PullRequest') }}:
- group: DotNet-HelixApi-Access - group: DotNet-HelixApi-Access
- _PushToVSFeed: true - _PushToVSFeed: true
- _SignType: real - _SignType: real
@ -168,13 +161,13 @@ jobs:
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines) /p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
$(_PgoInstrument) $(_PgoInstrument)
- template: /eng/common/templates/variables/pool-providers.yml - template: /eng/common/templates-official/variables/pool-providers.yml
steps: steps:
- checkout: self - checkout: self
clean: true clean: true
- ${{ if eq(parameters.agentOs, 'Windows_NT') }}: - ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- ${{ if and(not(parameters.isBuiltFromVmr), ne(variables['System.TeamProject'], 'public')) }}: - ${{ if not(parameters.isBuiltFromVmr) }}:
- task: PowerShell@2 - task: PowerShell@2
displayName: Setup Private Feeds Credentials displayName: Setup Private Feeds Credentials
inputs: inputs:
@ -195,7 +188,7 @@ jobs:
DOTNET_CLI_UI_LANGUAGE: ${{ parameters.dotnetCLIUILanguage }} DOTNET_CLI_UI_LANGUAGE: ${{ parameters.dotnetCLIUILanguage }}
- ${{ if ne(parameters.agentOs, 'Windows_NT') }}: - ${{ if ne(parameters.agentOs, 'Windows_NT') }}:
- ${{ if and(not(parameters.isBuiltFromVmr), ne(variables['System.TeamProject'], 'public')) }}: - ${{ if not(parameters.isBuiltFromVmr) }}:
- task: Bash@3 - task: Bash@3
displayName: Setup Private Feeds Credentials displayName: Setup Private Feeds Credentials
inputs: inputs:

View file

@ -1,6 +1,4 @@
# # Pipeline: https://dnceng.visualstudio.com/internal/_build?definitionId=1224
# See https://learn.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for details on this file.
#
schedules: schedules:
# Cron timezone is UTC. # Cron timezone is UTC.
@ -21,7 +19,7 @@ variables:
jobs: jobs:
- ${{ if and(ne(variables['System.TeamProject'], 'public'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.Reason'], 'Manual'))) }}: - ${{ if and(ne(variables['System.TeamProject'], 'public'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), eq(variables['Build.Reason'], 'Manual'))) }}:
- template: /eng/common/templates/job/onelocbuild.yml - template: /eng/common/templates-official/job/onelocbuild.yml
parameters: parameters:
CreatePr: ${{ ne(variables['Build.Reason'], 'Manual') }} CreatePr: ${{ ne(variables['Build.Reason'], 'Manual') }}
LclPackageId: 'LCL-JUNO-PROD-DOTNETINSTALLER' LclPackageId: 'LCL-JUNO-PROD-DOTNETINSTALLER'