diff --git a/.vsts-dotnet.yml b/.vsts-dotnet.yml index 72c45c9b52f..f4e59708348 100644 --- a/.vsts-dotnet.yml +++ b/.vsts-dotnet.yml @@ -10,12 +10,28 @@ trigger: # SignType: real # SkipApplyOptimizationData: false +parameters: +- name: OptProfDropName + displayName: Optional OptProfDrop Override + type: string + default: 'default' + variables: + # if OptProfDrop is not set, string '$(OptProfDrop)' will be passed to the build script. + - name: OptProfDrop + value: '' - name: SourceBranch value: $(IbcSourceBranchName) - - ${{ if startsWith(variables['Build.SourceBranch'], 'refs/heads/exp/') }}: + # If we're not on a vs* branch, use main as our optprof collection branch + - ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/vs')) }}: - name: SourceBranch value: main + # if OptProfDropName is set as a parameter, set OptProfDrop to the parameter and unset SourceBranch + - ${{ if ne(parameters.OptProfDropName, 'default') }}: + - name: OptProfDrop + value: ${{parameters.OptProfDropName}} + - name: SourceBranch + value: '' - name: _DotNetArtifactsCategory value: .NETCore - name: _DotNetValidationArtifactsCategory @@ -100,7 +116,7 @@ stages: /p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat) /p:TeamName=MSBuild /p:DotNetPublishUsingPipelines=true - /p:VisualStudioIbcDrop=$(OptProfDropName) + /p:VisualStudioIbcDrop=$(OptProfDrop) displayName: Build condition: succeeded()