@@ -12,6 +12,8 @@ variables:
1212 value : Packages
1313- name : SolutionFileName # Example: MyApplication.sln
1414 value : GeolocatorService.sln
15+ - name : IsReleaseBranch # Should this branch name use the release stage
16+ value : $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]
1517- name : windowsHostedAgentImage
1618 value : ' windows-2022'
1719
@@ -35,24 +37,22 @@ stages:
3537 value : $(Build.ArtifactStagingDirectory)
3638
3739 workspace :
38- clean : all # Cleanup the workspaca before starting
39-
40- container : windows
40+ clean : all # Cleanup the workspace before starting
4141
4242 steps :
4343 - template : stage-build.yml
4444
4545- stage : Release
46- # Only release when the build is not for a Pull Request.
47- condition : and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
46+ # Only release when the build is not for a Pull Request and branch name fits
47+ condition : and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), eq(variables['IsReleaseBranch'], 'true') )
4848 jobs :
49- - job : Publish_NuGet_Internal
49+ - job : Publish_NuGet_External
5050
5151 pool :
5252 vmImage : $(windowsHostedAgentImage)
5353
5454 workspace :
55- clean : all # Cleanup the workspaca before starting
55+ clean : all # Cleanup the workspace before starting
5656
5757 steps :
58- - template : stage-release.yml
58+ - template : stage-release.yml
0 commit comments