@@ -7,8 +7,6 @@ parameters:
7
7
default : true
8
8
9
9
variables :
10
- # This is expected to provide VisualStudioMarketplacePAT to the release (https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token)
11
- - group : vscode-csharp release secrets
12
10
# This is expected to provide pat to tag release.
13
11
- group : DncEng-Partners-Tokens
14
12
@@ -55,59 +53,63 @@ extends:
55
53
buildVersionToDownload : ' specific'
56
54
buildId : ' $(resources.pipeline.officialBuildCI.runID)'
57
55
branchName : ' $(resources.pipeline.officialBuildCI.sourceBranch)'
56
+ - template : /azure-pipelines/install-node.yml@self
58
57
- pwsh : |
59
- npm install --global vsce
58
+ npm install --global @vscode/ vsce
60
59
displayName: 'Install vsce'
61
- - pwsh : |
62
- # Choose whether to upload to prerelease or release based on the artifacts generated by the build pipeline.
63
- $artifactFolder = ""
64
- $uploadPrerelease = $true
65
- if (Test-Path -Path "VSIX_Prerelease") {
66
- $artifactFolder = "VSIX_Prerelease"
67
- $uploadPrerelease = $true
68
- } elseif (Test-Path -Path "VSIX_Release") {
69
- $artifactFolder = "VSIX_Release"
70
- $uploadPrerelease = $false
71
- } else {
72
- throw "No artifacts are downloaded."
73
- }
60
+ - task : AzureCLI@2
61
+ displayName : ' 🚀 Publish to Marketplace'
62
+ inputs :
63
+ azureSubscription : ' VSCode Marketplace Publishing'
64
+ scriptType : " pscore"
65
+ scriptLocation : ' inlineScript'
66
+ workingDirectory : $(Pipeline.Workspace)
67
+ inlineScript : |
68
+ # Choose whether to upload to prerelease or release based on the artifacts generated by the build pipeline.
69
+ $artifactFolder = ""
70
+ $uploadPrerelease = $true
71
+ if (Test-Path -Path "VSIX_Prerelease") {
72
+ $artifactFolder = "VSIX_Prerelease"
73
+ $uploadPrerelease = $true
74
+ } elseif (Test-Path -Path "VSIX_Release") {
75
+ $artifactFolder = "VSIX_Release"
76
+ $uploadPrerelease = $false
77
+ } else {
78
+ throw "No artifacts are downloaded."
79
+ }
74
80
75
- Write-Host "Uploading artifacts from $artifactFolder with prerelease=$uploadPrerelease"
81
+ Write-Host "Uploading artifacts from $artifactFolder with prerelease=$uploadPrerelease"
76
82
77
- # Our build pipeline would generated build based on attempt number. Publishing the latest attempt.
78
- $allArtifacts = Get-ChildItem -Path "$artifactFolder*" | Sort-Object -Descending
79
- if ($allArtifacts.Length -eq 0) {
80
- throw "No artifacts in $artifactFolder"
81
- }
83
+ # Our build pipeline would generated build based on attempt number. Publishing the latest attempt.
84
+ $allArtifacts = Get-ChildItem -Path "$artifactFolder*" | Sort-Object -Descending
85
+ if ($allArtifacts.Length -eq 0) {
86
+ throw "No artifacts in $artifactFolder"
87
+ }
82
88
83
- $publishArtifacts = $allArtifacts[0]
84
- Write-Host "All artifacts: $($allArtifacts). Publishing $($publishArtifacts)."
89
+ $publishArtifacts = $allArtifacts[0]
90
+ Write-Host "All artifacts: $($allArtifacts). Publishing $($publishArtifacts)."
85
91
86
- $basePublishArgs = , "publish"
87
- If ( $uploadPrerelease ) {
88
- $basePublishArgs += "--pre-release"
89
- Write-Host "Publish to pre-release channel."
90
- } Else {
91
- Write-Host "Publish to release channel."
92
- }
93
- $basePublishArgs += '--packagePath'
94
- $publishArgs = $basePublishArgs + (Get-ChildItem $publishArtifacts\*.vsix | Sort-Object Name -Descending |% { $_ })
92
+ $basePublishArgs = , "publish --azure-credential "
93
+ If ( $uploadPrerelease ) {
94
+ $basePublishArgs += "--pre-release"
95
+ Write-Host "Publish to pre-release channel."
96
+ } Else {
97
+ Write-Host "Publish to release channel."
98
+ }
99
+ $basePublishArgs += '--packagePath'
100
+ $publishArgs = $basePublishArgs + (Get-ChildItem $publishArtifacts\*.vsix | Sort-Object Name -Descending |% { $_ })
95
101
96
- If ("${{ parameters.test }}" -eq "true") {
97
- Write-Host "In test mode, command is printed instead of run."
98
- Write-Host "##[command]vsce $publishArgs"
102
+ If ("${{ parameters.test }}" -eq "true") {
103
+ Write-Host "In test mode, command is printed instead of run."
104
+ Write-Host "##[command]vsce $publishArgs"
99
105
100
- Write-Host "🔒 Verify PAT."
101
- vsce verify-pat ms-dotnettools
102
- }
103
- Else {
104
- Write-Host "##[command]vsce $publishArgs"
105
- vsce @publishArgs
106
- }
107
- displayName: 🚀 Publish to Marketplace
108
- workingDirectory: $(Pipeline.Workspace)
109
- env:
110
- VSCE_PAT: $(VSCodeMarketplacePAT)
106
+ Write-Host "🔒 Verify PAT."
107
+ vsce verify-pat --azure-credential ms-dotnettools
108
+ }
109
+ Else {
110
+ Write-Host "##[command]vsce $publishArgs"
111
+ vsce @publishArgs
112
+ }
111
113
- stage : ' TagRelease'
112
114
displayName : ' Tag release of vscode-csharp'
113
115
dependsOn : ' PublishStage'
@@ -119,15 +121,12 @@ extends:
119
121
image : 1es-ubuntu-2204
120
122
os : linux
121
123
steps :
122
- - task : NodeTool@0
123
- displayName : ' Install Node.js 18.x'
124
- inputs :
125
- versionSpec : ' 18.x'
126
124
- checkout : self
127
125
clean : true
128
126
submodules : true
129
127
fetchTags : false
130
128
fetchDepth : 0
129
+ - template : /azure-pipelines/install-node.yml@self
131
130
- pwsh : |
132
131
git checkout $(resources.pipeline.officialBuildCI.sourceCommit)
133
132
displayName: 'Checkout build source branch'
0 commit comments