Skip to content

Commit 28012e7

Browse files
authored
Add VMR unified build pipelines (#18409)
Contributes to dotnet/source-build#3823 - Removes and consolidates vmr-cross-build.yml/ci-cross-build.yml POC into vmr-build.yml/ci.yml - Add stage for building vertical/unified build legs into vmr-build.yml - Adds Windows build and handling for Windows/Unix differences
1 parent 76a118e commit 28012e7

15 files changed

+954
-783
lines changed

Diff for: eng/pipelines/templates/jobs/vmr-build.yml

+216-170
Large diffs are not rendered by default.

Diff for: eng/pipelines/templates/stages/vmr-build.yml

+347-269
Large diffs are not rendered by default.

Diff for: eng/pipelines/templates/stages/vmr-cross-build.yml

-177
This file was deleted.

Diff for: eng/pipelines/templates/steps/vmr-pull-updates.yml

+35-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,19 @@ steps:
3333
- script: |
3434
git checkout -B ${{ parameters.vmrBranch }}
3535
echo "##vso[task.setvariable variable=vmrBranch]${{ parameters.vmrBranch }}"
36-
mkdir -p ${{ parameters.vmrPath }}/artifacts/x64/Release
3736
displayName: Prepare branch ${{ parameters.vmrBranch }}
3837
workingDirectory: ${{ parameters.vmrPath }}
3938

39+
- script: |
40+
mkdir -p ${{ parameters.vmrPath }}/artifacts/x64/Release
41+
displayName: Create artifacts folder (Unix)
42+
condition: ne(variables['Agent.OS'], 'Windows_NT')
43+
44+
- powershell: |
45+
New-Item -ItemType Directory -Path ${{ parameters.vmrPath }}/artifacts/x64/Release
46+
displayName: Create artifacts folder (Windows)
47+
condition: eq(variables['Agent.OS'], 'Windows_NT')
48+
4049
- script: |
4150
git config --global user.name "dotnet-maestro[bot]"
4251
git config --global user.email "dotnet-maestro[bot]@users.noreply.github.com"
@@ -57,13 +66,36 @@ steps:
5766
--branch ${{ parameters.vmrBranch }}
5867
--repository "installer:${{ parameters.targetRef }}"
5968
--recursive
60-
--remote "installer:$(pwd)"
69+
--remote "installer:$(Agent.BuildDirectory)/installer"
6170
--component-template $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/Component.template.md
6271
--tpn-template $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt
6372
--debug
6473
||
6574
(echo "##vso[task.logissue type=error]Failed to synchronize the VMR" && exit 1)
66-
displayName: Synchronize dotnet/dotnet
75+
displayName: Synchronize dotnet/dotnet (Unix)
76+
condition: ne(variables['Agent.OS'], 'Windows_NT')
77+
workingDirectory: $(Agent.BuildDirectory)/installer
78+
79+
- powershell: >
80+
./eng/vmr-sync.ps1 `
81+
-vmr ${{ parameters.vmrPath }} `
82+
-tmp $(Agent.TempDirectory) `
83+
-azdevPat '$(dn-bot-all-orgs-code-r)' `
84+
-branch ${{ parameters.vmrBranch }} `
85+
-repository "installer:${{ parameters.targetRef }}" `
86+
-recursive `
87+
# passing remote fails for some reason, but it is the default anyway
88+
# -remote "installer:$(Agent.BuildDirectory)/installer"
89+
-componentTemplate $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/Component.template.md `
90+
-tpnTemplate $(Agent.BuildDirectory)/installer/src/VirtualMonoRepo/THIRD-PARTY-NOTICES.template.txt `
91+
-debug
92+
93+
if ($LASTEXITCODE -ne 0) {
94+
echo "##vso[task.logissue type=error]Failed to synchronize the VMR"
95+
exit 1
96+
}
97+
displayName: Synchronize dotnet/dotnet (Windows)
98+
condition: eq(variables['Agent.OS'], 'Windows_NT')
6799
workingDirectory: $(Agent.BuildDirectory)/installer
68100

69101
- publish: $(Agent.TempDirectory)

Diff for: eng/pipelines/templates/variables/vmr-stage.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
parameters:
2+
- name: vmrBranch
3+
type: string
4+
5+
variables:
6+
- ${{ if ne(parameters.vmrBranch, '') }}:
7+
- name: VmrBranch
8+
value: ${{ parameters.vmrBranch }}
9+
- ${{ else }}:
10+
- name: VmrBranch
11+
value: ${{ replace(replace(variables['Build.SourceBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
12+
13+
- name: alpine319Container
14+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.19-WithNode
15+
- name: centOSStream8Container
16+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8
17+
- name: centOSStream9Container
18+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9
19+
- name: fedora39Container
20+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-39
21+
- name: ubuntu2204Container
22+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04
23+
- name: ubuntu2204ArmContainer
24+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-22.04-arm64
25+
- name: marinerX64CrossContainer
26+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-amd64
27+
- name: marinerArm64CrossContainer
28+
value: mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-cross-arm64
29+
30+
- ${{ if eq(variables['System.TeamProject'], 'public') }}:
31+
- name: defaultPoolName
32+
value: NetCore-Public-XL
33+
- name: defaultPoolDemandsLinux
34+
value: ImageOverride -equals Build.Ubuntu.1804.Amd64.Open
35+
- name: defaultPoolDemandsWindows
36+
value: ImageOverride -equals windows.vs2022.amd64.open
37+
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
38+
- ${{ if in(variables['Build.Reason'], 'PullRequest') }}:
39+
- name: defaultPoolName
40+
value: NetCore1ESPool-Internal-XL
41+
- ${{ else }}:
42+
- name: defaultPoolName
43+
value: NetCore1ESPool-Svc-Internal
44+
- name: defaultPoolDemandsLinux
45+
value: ImageOverride -equals Build.Ubuntu.1804.Amd64
46+
- name: defaultPoolDemandsWindows
47+
value: ImageOverride -equals windows.vs2022.amd64
48+
49+
- name: defaultPoolNameLinuxArm64
50+
value: Docker-Linux-Arm-Internal
51+
52+
- name: defaultPoolNameMac
53+
value: macos-12

Diff for: eng/pipelines/vmr-build-internal.yml

-53
This file was deleted.

Diff for: eng/pipelines/vmr-build.yml

+20-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# This yml is used by these pipelines and triggers:
2+
#
3+
# - installer-source-build (public)
4+
# - PR: release/* and main, ultralite build
5+
# - installer-unified-build (public)
6+
# - PR: release/* and main, lite build
7+
18
trigger: none
29
pr:
310
branches:
@@ -15,8 +22,8 @@ parameters:
1522
type: string
1623
default: ' '
1724

18-
- name: disableVmrBuild
19-
displayName: Skip source-building the VMR
25+
- name: disableBuild
26+
displayName: Skip the VMR Build stage
2027
type: boolean
2128
default: false
2229

@@ -28,6 +35,10 @@ variables:
2835
- name: VmrBranch
2936
value: ${{ replace(replace(variables['System.PullRequest.TargetBranch'], 'refs/heads/', ''), 'refs/pull/', '') }}
3037

38+
# enable source-only build for pipelines with the -source-build suffix
39+
- name: isSourceOnlyBuild
40+
value: ${{ contains(variables['Build.DefinitionName'], '-source-build') }}
41+
3142
resources:
3243
repositories:
3344
- repository: vmr
@@ -37,12 +48,17 @@ resources:
3748
ref: ${{ variables.VmrBranch }}
3849

3950
stages:
40-
# You can temporarily disable the VMR Build stage by setting the disableVmrBuild variable
41-
- ${{ if not(parameters.disableVmrBuild) }}:
51+
# You can temporarily disable the VMR Build stage by setting the disableBuild variable
52+
- ${{ if not(parameters.disableBuild) }}:
4253
- template: templates/stages/vmr-build.yml
4354
parameters:
4455
vmrBranch: ${{ variables.VmrBranch }}
4556
isBuiltFromVmr: false
57+
isSourceOnlyBuild: ${{ variables.isSourceOnlyBuild }}
58+
${{ if eq(variables.isSourceOnlyBuild, 'true') }}:
59+
scope: ultralite
60+
${{ else }}:
61+
scope: lite
4662

4763
# In case the VMR Build stage is temporarily disabled, the VMR synchronization step is run to validate
4864
# that the PR can be merged and later synchronized into the VMR without problems.

0 commit comments

Comments
 (0)