diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 355c9c2b8bc34..50460f8d2fabc 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -34,6 +34,11 @@ parameters: type: boolean default: true +# If running on a branch that's not in PublishData.json but still want to publish packages for VS insertion, set this to `main`. +- name: PublishAsBranch + type: string + default: current + # The variables `_DotNetArtifactsCategory` and `_DotNetValidationArtifactsCategory` are required for proper publishing of build artifacts. See https://github.com/dotnet/roslyn/pull/38259 variables: - name: _DotNetArtifactsCategory @@ -72,6 +77,12 @@ variables: - name: Insertion.TitleSuffix value: '' + - name: PublishAsBranchOrNull + ${{ if eq(parameters.PublishAsBranch, 'current') }}: + value: null + ${{ else }}: + value: ${{ parameters.PublishAsBranch }} + stages: - stage: build @@ -213,7 +224,7 @@ stages: displayName: Publish Assets inputs: filePath: 'eng\publish-assets.ps1' - arguments: '-configuration $(BuildConfiguration) -branchName "$(SourceBranchName)"' + arguments: '-configuration $(BuildConfiguration) -branchName "${{ coalesce(variables.PublishAsBranchOrNull, variables.SourceBranchName) }}"' condition: succeeded() # Publish OptProf configuration files