Skip to content

Commit 6e8e121

Browse files
authored
Check OneLocReleaseBranch at runtime instead of compile-time (#7159)
1 parent 7c59687 commit 6e8e121

2 files changed

Lines changed: 14 additions & 5 deletions

File tree

eng/pipelines/official.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ extends:
5151
- template: /eng/pipelines/templates/pipeline.yml@self
5252
parameters:
5353
isOfficialBuild: true
54-
${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/dev'), eq(variables['Build.SourceBranch'], format('refs/heads/{0}', variables['OneLocReleaseBranch']))) }}:
55-
RunOneLocBuild: true
5654
RunBuildForPublishing: ${{parameters.RunBuildForPublishing}}
5755
SigningType: ${{ parameters.SigningType }}
56+
TryRunOneLocBuild: true

eng/pipelines/templates/pipeline.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ parameters:
22
- name: isOfficialBuild
33
type: boolean
44
default: false
5-
- name: RunOneLocBuild
6-
displayName: Run OneLocBuild
5+
- name: TryRunOneLocBuild
6+
displayName: Run OneLocBuild if on dev or a OneLoc release branch
77
type: boolean
88
default: false
99
- name: RunBuildForPublishing
@@ -43,9 +43,19 @@ stages:
4343
steps:
4444
- template: /eng/pipelines/templates/Initialize_Build.yml@self
4545

46-
- ${{ if eq(parameters.RunOneLocBuild, true) }}:
46+
- ${{ if eq(parameters.TryRunOneLocBuild, true) }}:
4747
- stage: RunOneLocBuild
4848
displayName: Run OneLocBuild
49+
condition: |
50+
and(
51+
succeeded(),
52+
eq(variables['IsOfficialBuild'], 'true'),
53+
or(
54+
eq(variables['Build.SourceBranch'], 'refs/heads/dev'),
55+
eq(variables['Build.SourceBranch'], variables['OneLocReleaseBranch']),
56+
eq(variables['Build.SourceBranch'], format('refs/heads/{0}', variables['OneLocReleaseBranch']))
57+
)
58+
)
4959
jobs:
5060
- template: /eng/common/templates-official/job/onelocbuild.yml
5161
parameters:

0 commit comments

Comments
 (0)