|
1 |
| -# This is the dotnet/dotnet pipeline that is triggered every weekday at midnight PST (08:00 UTC) for "main" and when changes are pushed to release/* and internal/release/* branches. |
| 1 | +# This yml is used by these pipelines and triggers: |
| 2 | +# NOTE: the triggers are defined in the Azure DevOps UI as they are too complex |
| 3 | +# |
| 4 | +# - dotnet-source-build (public) |
| 5 | +# - PR: ultralite build |
| 6 | +# - CI: release/* only, every batched commit, full build |
| 7 | +# - Schedule: main only, full build |
| 8 | +# |
| 9 | +# - dotnet-unified-build (public) |
| 10 | +# - PR: lite build |
| 11 | +# - CI: release/* only, every batched commit, full build |
| 12 | +# - Schedule: main only, full build |
| 13 | +# |
| 14 | +# - dotnet-source-build (internal) |
| 15 | +# - PR: ultralite build |
| 16 | +# - CI: release/* and internal/release/* only, every batched commit, full build |
| 17 | +# - CI: main only, every batched commit, lite build |
| 18 | +# - Schedule: main only, full build |
| 19 | +# |
| 20 | +# - dotnet-unified-build (internal) |
| 21 | +# - PR: lite build |
| 22 | +# - CI: release/*, internal/release/* and main, every batched commit, full build |
2 | 23 |
|
3 |
| -schedules: |
4 |
| -- cron: '0 8 * * Mon-Fri' |
5 |
| - displayName: Weekday midnight build |
6 |
| - branches: |
7 |
| - include: |
8 |
| - - main |
9 |
| - batch: true |
| 24 | +variables: |
| 25 | +# enable source-only build for pipelines that contain the -source-build string |
| 26 | +- name: isSourceOnlyBuild |
| 27 | + value: ${{ contains(variables['Build.DefinitionName'], '-source-build') }} |
10 | 28 |
|
11 |
| -trigger: |
12 |
| - batch: true |
13 |
| - branches: |
14 |
| - include: |
15 |
| - - release/* |
16 |
| - - internal/release/* |
| 29 | +- name: isInternalBuild |
| 30 | + value: ${{ eq(variables['System.TeamProject'], 'internal') }} |
17 | 31 |
|
18 |
| -pr: none |
| 32 | +- name: isMainBranch |
| 33 | + value: ${{ eq(variables['Build.SourceBranch'], 'refs/heads/main') }} |
| 34 | + |
| 35 | +- name: isScheduleTrigger |
| 36 | + value: ${{ eq(variables['Build.Reason'], 'Schedule') }} |
| 37 | + |
| 38 | +- name: isPRTrigger |
| 39 | + value: ${{ eq(variables['Build.Reason'], 'PullRequest') }} |
19 | 40 |
|
20 | 41 | stages:
|
21 | 42 | - template: templates/stages/vmr-scan.yml
|
22 | 43 |
|
23 | 44 | - template: /src/installer/eng/pipelines/templates/stages/vmr-build.yml
|
24 | 45 | parameters:
|
25 | 46 | isBuiltFromVmr: true
|
26 |
| - isLiteBuild: false |
| 47 | + isSourceOnlyBuild: ${{ variables.isSourceOnlyBuild }} |
| 48 | + ${{ if eq(variables.isScheduleTrigger, 'true') }}: |
| 49 | + scope: full |
| 50 | + ${{ elseif and(eq(variables.isPRTrigger, 'true'), eq(variables.isSourceOnlyBuild, 'true')) }}: |
| 51 | + scope: ultralite |
| 52 | + ${{ elseif and(eq(variables.isPRTrigger, 'true'), not(eq(variables.isSourceOnlyBuild, 'true'))) }}: |
| 53 | + scope: lite |
| 54 | + ${{ elseif and(not(eq(variables.isPRTrigger, 'true')), eq(variables.isSourceOnlyBuild, 'true'), eq(variables.isInternalBuild, 'true'), eq(variables.isMainBranch, 'true')) }}: |
| 55 | + scope: lite |
| 56 | + ${{ else }}: |
| 57 | + scope: full |
0 commit comments