77 branches :
88 include :
99 - main
10+ - refs/tags/v*
1011pr : none
1112
1213pool :
@@ -103,13 +104,13 @@ stages:
103104
104105 - task : UseDotNet@2
105106 displayName : " Add .NET 2"
106- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
107+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
107108 inputs :
108109 version : 2.x
109110
110111 - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
111112 displayName : " ESRP DLL Strong Name"
112- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
113+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
113114 inputs :
114115 ConnectedServiceName : " microsoftgraph ESRP CodeSign DLL and NuGet (AKV)"
115116 FolderPath : $(ProductBinPath)
@@ -136,7 +137,7 @@ stages:
136137
137138 - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
138139 displayName : " ESRP DLL CodeSigning"
139- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
140+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
140141 inputs :
141142 ConnectedServiceName : " microsoftgraph ESRP CodeSign DLL and NuGet (AKV)"
142143 FolderPath : src
@@ -183,14 +184,14 @@ stages:
183184
184185 # arguments are not parsed in DotNetCoreCLI@2 task for `pack` command, that's why we have a custom pack command here
185186 - pwsh : dotnet pack "$(ProjectFile)" /p:IncludeSymbols=true /p:SymbolPackageFormat=snupkg --no-build --output $env:BUILD_ARTIFACTSTAGINGDIRECTORY/Nugets --configuration $env:BUILD_CONFIGURATION
186- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
187+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
187188 env :
188189 BUILD_CONFIGURATION : $(BuildConfiguration)
189190 displayName : Dotnet pack
190191
191192 - task : PowerShell@2
192193 displayName : " Validate project version has been incremented"
193- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
194+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
194195 inputs :
195196 targetType : " filePath"
196197 filePath : $(System.DefaultWorkingDirectory)\scripts\ValidateProjectVersionUpdated.ps1
@@ -199,7 +200,7 @@ stages:
199200
200201 - task : SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
201202 displayName : " ESRP CodeSigning Nuget Packages"
202- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
203+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
203204 inputs :
204205 ConnectedServiceName : " microsoftgraph ESRP CodeSign DLL and NuGet (AKV)"
205206 FolderPath : " $(Build.ArtifactStagingDirectory)/Nugets"
@@ -226,21 +227,21 @@ stages:
226227
227228 - task : CopyFiles@2
228229 displayName : " Copy release scripts to artifact staging directory"
229- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
230+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
230231 inputs :
231232 SourceFolder : " $(Build.SourcesDirectory)"
232233 Contents : ' scripts\**'
233234 TargetFolder : " $(Build.ArtifactStagingDirectory)/Nugets"
234235
235236 - task : PublishPipelineArtifact@1
236237 displayName : " Upload Artifact: Nugets"
237- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
238+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
238239 inputs :
239240 artifactName : Nugets
240241 targetPath : $(Build.ArtifactStagingDirectory)/Nugets
241242
242243 - stage : deploy
243- condition : and(contains( variables['build.sourceBranch '], 'refs/heads/main'), succeeded( ))
244+ condition : and(succeeded(), startsWith( variables['Build.SourceBranch '], 'refs/tags/v' ))
244245 dependsOn : build
245246 jobs :
246247 - deployment : deploy_cli_core
0 commit comments