@@ -51,6 +51,27 @@ extends:
51
51
runOnce :
52
52
deploy :
53
53
steps :
54
+ - pwsh : |
55
+ $artifactVersion = '$(resources.pipeline.officialBuildCI.runName)'
56
+ $artifactBranchName = '$(resources.pipeline.officialBuildCI.sourceBranch)' -replace 'refs/heads/',''
57
+
58
+ # Set the BuildNumber in the form `# Publish prerelease v2.69.22 #` to improve readability in AzDO
59
+ $buildNumberName = "Publish $artifactBranchName $artifactVersion"
60
+ if ('${{ parameters.test }}' -eq 'true') {
61
+ $buildNumberName = 'Test ' + $buildNumberName
62
+ }
63
+
64
+ # Replace invalid characters
65
+ $buildNumberName = $buildNumberName -replace '["/:<>\|?@*]','_'
66
+ # Maximum buildnumber length is 255 chars and we are going to add a prefix and suffix so ensure we have space.
67
+ if ($buildNumberName.Length -GT 252) {
68
+ $buildNumberName = $buildNumberName.Substring(0, 252)
69
+ }
70
+ # Avoid ever ending the BuildNumber with a `.` by always appending to it.
71
+ $buildNumberName = ' ' + $buildNumberName + ' #'
72
+
73
+ Write-Host "##vso[build.updatebuildnumber]$buildNumberName"
74
+ displayName: Set BuildNumber
54
75
- template : /azure-pipelines/install-node.yml@self
55
76
- pwsh : |
56
77
npm install --global @vscode/vsce
@@ -113,6 +134,7 @@ extends:
113
134
Write-Host "##[command]vsce $publishArgs"
114
135
vsce @publishArgs
115
136
}
137
+
116
138
- stage : ' TagRelease'
117
139
displayName : ' Tag release of vscode-csharp'
118
140
dependsOn : ' PublishStage'
0 commit comments