From e5a38630668907c1f2b0abee2688af2f3c3c8361 Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Mon, 8 Sep 2025 14:59:06 -0700 Subject: [PATCH 1/2] Refactor conditions for Prerelease and Release stages - Allow arbitrary branches to be manually built and live tested without being released - Only allow releases from manually queued runs of `main` or `hotfix/*` --- .../templates/stages/archetype-sdk-client.yml | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index 52e1ddc6cd..f045f8f1d5 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -138,16 +138,18 @@ extends: SubscriptionConfigurationFilePaths: ${{ cloud.value.SubscriptionConfigurationFilePaths }} # The Prerelease and Release stages are conditioned on: - # 1. Internal trigger, not Pull Request trigger + # 1. Internal pipeline + # 2. Only release from main or hotfix/* # 2. Not weekly build # 3. Manual trigger or force IncludeRelease - - ${{ if and(not(startsWith(variables['Build.SourceBranchName'], 'refs/pull/')), eq(variables['System.TeamProject'], 'internal')) }}: - - ${{ if not(contains(variables['Build.DefinitionName'], 'weekly')) }}: - - ${{ if or(in(variables['Build.Reason'], 'Manual', ''), eq(parameters.IncludeRelease, true)) }}: - - template: archetype-rust-release.yml - parameters: - DependsOn: "Build" - ServiceDirectory: ${{ parameters.ServiceDirectory }} - Artifacts: ${{ parameters.Artifacts }} - TestPipeline: ${{ eq(parameters.ServiceDirectory, 'template') }} - PipelineArtifactName: packages + - ${{ if eq(variables['System.TeamProject'], 'internal') }}: + - ${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')) }}: + - ${{ if not(contains(variables['Build.DefinitionName'], 'weekly')) }}: + - ${{ if or(in(variables['Build.Reason'], 'Manual', ''), eq(parameters.IncludeRelease, true)) }}: + - template: archetype-rust-release.yml + parameters: + DependsOn: "Build" + ServiceDirectory: ${{ parameters.ServiceDirectory }} + Artifacts: ${{ parameters.Artifacts }} + TestPipeline: ${{ eq(parameters.ServiceDirectory, 'template') }} + PipelineArtifactName: packages From bb7a073752bea0cb7c84b17adfb6d20d06d4917b Mon Sep 17 00:00:00 2001 From: Patrick Hallisey Date: Mon, 8 Sep 2025 15:00:08 -0700 Subject: [PATCH 2/2] Update eng/pipelines/templates/stages/archetype-sdk-client.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- eng/pipelines/templates/stages/archetype-sdk-client.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/pipelines/templates/stages/archetype-sdk-client.yml b/eng/pipelines/templates/stages/archetype-sdk-client.yml index f045f8f1d5..bb6039275d 100644 --- a/eng/pipelines/templates/stages/archetype-sdk-client.yml +++ b/eng/pipelines/templates/stages/archetype-sdk-client.yml @@ -140,8 +140,8 @@ extends: # The Prerelease and Release stages are conditioned on: # 1. Internal pipeline # 2. Only release from main or hotfix/* - # 2. Not weekly build - # 3. Manual trigger or force IncludeRelease + # 3. Not weekly build + # 4. Manual trigger or force IncludeRelease - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - ${{ if or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')) }}: - ${{ if not(contains(variables['Build.DefinitionName'], 'weekly')) }}: