diff --git a/tools/devops/automation/templates/main-stage.yml b/tools/devops/automation/templates/main-stage.yml index fbac343cd7..23135555c0 100644 --- a/tools/devops/automation/templates/main-stage.yml +++ b/tools/devops/automation/templates/main-stage.yml @@ -52,6 +52,10 @@ parameters: type: boolean default: false # only to be used when testing the CI and we do not need a signed pkg +- name: skipInsertion + type: boolean + default: false # just to be skipped by the unified pipeline. + - name: isPR type: boolean @@ -255,18 +259,19 @@ stages: repositoryAlias: ${{ parameters.repositoryAlias }} commit: ${{ parameters.commit }} -# .NET Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc -# setting the stage at this level makes the graph of the UI look better, else the lines overlap and is not clear. -# Got to disable the lint check because azp yaml template engine does not allow use to do a multiline if :/ -# yamllint disable-line rule: line-length -- ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release-test/'), eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'), eq(variables['Build.SourceBranch'], 'refs/heads/net8.0'), eq(parameters.forceInsertion, true))) }}: - - template: ./release/vs-insertion-prep.yml - parameters: - dependsOn: - - sign_notarize_dotnet - isPR: ${{ parameters.isPR }} - repositoryAlias: ${{ parameters.repositoryAlias }} - commit: ${{ parameters.commit }} +- ${{ if eq(parameters.skipInsertion, false) }}: + # .NET Release Prep and VS Insertion Stages, only execute them when the build comes from an official branch and is not a schedule build from OneLoc + # setting the stage at this level makes the graph of the UI look better, else the lines overlap and is not clear. + # Got to disable the lint check because azp yaml template engine does not allow use to do a multiline if :/ + # yamllint disable-line rule: line-length + - ${{ if and(ne(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release-test/'), eq(variables['Build.SourceBranch'], 'refs/heads/net7.0'), eq(variables['Build.SourceBranch'], 'refs/heads/net8.0'), eq(parameters.forceInsertion, true))) }}: + - template: ./release/vs-insertion-prep.yml + parameters: + dependsOn: + - sign_notarize_dotnet + isPR: ${{ parameters.isPR }} + repositoryAlias: ${{ parameters.repositoryAlias }} + commit: ${{ parameters.commit }} - stage: funnel displayName: '${{ parameters.stageDisplayNamePrefix }}Collect signed artifacts'