From 036ae2e3507b3d2a515be65c842c8b6042906764 Mon Sep 17 00:00:00 2001 From: deepchoudhery Date: Tue, 14 Sep 2021 14:20:18 -0700 Subject: [PATCH 1/3] adding if conditions for debug and release jobs --- azure-pipelines.yml | 78 ++++++++++++++++++++++++++++++--------------- 1 file changed, 52 insertions(+), 26 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9cbd49e0a..e549455c2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,25 +77,41 @@ stages: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) strategy: - matrix: - Build_Debug: - _BuildConfig: Debug - _PublishType: none - _SignType: test - _DotNetPublishToBlobFeed : false - Build_Release: - _BuildConfig: Release - # PRs or external builds are not signed. - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: + ${{ if ne(variables['System.TeamProject'], 'public') }}: + matrix: + Build_Release: + _BuildConfig: Release + # PRs or external builds are not signed. + ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: + _PublishType: none + _SignType: test + _DotNetPublishToBlobFeed : false + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + _PublishType: blob + _SignType: real + _DotNetPublishToBlobFeed : true + # _Script: eng\validate-sdk.cmd + # _ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken) + ${{ if eq(variables['System.TeamProject'], 'public') }}: + matrix: + Build_Debug: + _BuildConfig: Debug _PublishType: none _SignType: test _DotNetPublishToBlobFeed : false - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - _PublishType: blob - _SignType: real - _DotNetPublishToBlobFeed : true - # _Script: eng\validate-sdk.cmd - # _ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken) + Build_Release: + _BuildConfig: Release + # PRs or external builds are not signed. + ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: + _PublishType: none + _SignType: test + _DotNetPublishToBlobFeed : false + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + _PublishType: blob + _SignType: real + _DotNetPublishToBlobFeed : true + # _Script: eng\validate-sdk.cmd + # _ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken) steps: - checkout: self clean: true @@ -111,11 +127,16 @@ stages: pool: name: Hosted macOS strategy: - matrix: - debug_configuration: - _BuildConfig: Debug - release_configuration: - _BuildConfig: Release + ${{ if eq(variables['System.TeamProject'], 'public') }}: + matrix: + debug_configuration: + _BuildConfig: Debug + release_configuration: + _BuildConfig: Release + ${{ if ne(variables['System.TeamProject'], 'public') }}: + matrix: + release_configuration: + _BuildConfig: Release steps: - checkout: self clean: true @@ -131,11 +152,16 @@ stages: name: Hosted Ubuntu 1604 container: LinuxContainer strategy: - matrix: - debug_configuration: - _BuildConfig: Debug - release_configuration: - _BuildConfig: Release + ${{ if eq(variables['System.TeamProject'], 'public') }}: + matrix: + debug_configuration: + _BuildConfig: Debug + release_configuration: + _BuildConfig: Release + ${{ if ne(variables['System.TeamProject'], 'public') }}: + matrix: + release_configuration: + _BuildConfig: Release steps: - checkout: self clean: true From 2583ac4d49f0c098acbc2c9617f2b5dce95acd0a Mon Sep 17 00:00:00 2001 From: deepchoudhery Date: Tue, 14 Sep 2021 23:48:27 -0700 Subject: [PATCH 2/3] simplifying matrix block in azure-pipelines.yml --- azure-pipelines.yml | 68 +++++++++++++++------------------------------ 1 file changed, 23 insertions(+), 45 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e549455c2..9f9fbed4c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,41 +77,26 @@ stages: /p:OfficialBuildId=$(BUILD.BUILDNUMBER) strategy: - ${{ if ne(variables['System.TeamProject'], 'public') }}: - matrix: - Build_Release: - _BuildConfig: Release - # PRs or external builds are not signed. - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - _PublishType: none - _SignType: test - _DotNetPublishToBlobFeed : false - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - _PublishType: blob - _SignType: real - _DotNetPublishToBlobFeed : true - # _Script: eng\validate-sdk.cmd - # _ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken) - ${{ if eq(variables['System.TeamProject'], 'public') }}: - matrix: + matrix: + Build_Release: + _BuildConfig: Release + # PRs or external builds are not signed. + ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: + _PublishType: none + _SignType: test + _DotNetPublishToBlobFeed : false + ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: + _PublishType: blob + _SignType: real + _DotNetPublishToBlobFeed : true + # _Script: eng\validate-sdk.cmd + # _ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken) + ${{ if eq(variables['System.TeamProject'], 'public') }}: Build_Debug: _BuildConfig: Debug _PublishType: none _SignType: test _DotNetPublishToBlobFeed : false - Build_Release: - _BuildConfig: Release - # PRs or external builds are not signed. - ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}: - _PublishType: none - _SignType: test - _DotNetPublishToBlobFeed : false - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: - _PublishType: blob - _SignType: real - _DotNetPublishToBlobFeed : true - # _Script: eng\validate-sdk.cmd - # _ValidateSdkArgs: -gitHubPat $(BotAccount-dotnet-maestro-bot-PAT) -barToken $(MaestroAccessToken) steps: - checkout: self clean: true @@ -127,16 +112,12 @@ stages: pool: name: Hosted macOS strategy: - ${{ if eq(variables['System.TeamProject'], 'public') }}: - matrix: + matrix: + release_configuration: + _BuildConfig: Release + ${{ if eq(variables['System.TeamProject'], 'public') }}: debug_configuration: _BuildConfig: Debug - release_configuration: - _BuildConfig: Release - ${{ if ne(variables['System.TeamProject'], 'public') }}: - matrix: - release_configuration: - _BuildConfig: Release steps: - checkout: self clean: true @@ -153,15 +134,12 @@ stages: container: LinuxContainer strategy: ${{ if eq(variables['System.TeamProject'], 'public') }}: - matrix: + matrix: + release_configuration: + _BuildConfig: Release + ${{ if eq(variables['System.TeamProject'], 'public') }}: debug_configuration: _BuildConfig: Debug - release_configuration: - _BuildConfig: Release - ${{ if ne(variables['System.TeamProject'], 'public') }}: - matrix: - release_configuration: - _BuildConfig: Release steps: - checkout: self clean: true From 0e029cc7aa975381c9c3565d10744eb5f817a9f8 Mon Sep 17 00:00:00 2001 From: deepchoudhery Date: Tue, 14 Sep 2021 23:51:03 -0700 Subject: [PATCH 3/3] minor fix in azure-pipelines.yml --- azure-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9f9fbed4c..537a973fb 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -133,7 +133,6 @@ stages: name: Hosted Ubuntu 1604 container: LinuxContainer strategy: - ${{ if eq(variables['System.TeamProject'], 'public') }}: matrix: release_configuration: _BuildConfig: Release