Skip to content

Commit ca052fc

Browse files
committed
Update ADO to handle --pre-release
And better quoting/pathing.
1 parent 41003c1 commit ca052fc

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.vsts-ci/templates/ci-general.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ steps:
7272
Install-Module InvokeBuild -Scope CurrentUser -Force
7373
Install-Module platyPS -Scope CurrentUser -Force
7474
Invoke-Build -Configuration Release
75-
Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-*.vsix)"
75+
$PackageJson = Get-Content -Raw package.json | ConvertFrom-Json
76+
Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-$($PackageJson.version).vsix)"
7677
workingDirectory: $(Build.SourcesDirectory)/vscode-powershell
7778
pwsh: ${{ parameters.pwsh }}
7879

@@ -81,9 +82,9 @@ steps:
8182
inputs:
8283
targetType: inline
8384
script: |
84-
$assembly = [Reflection.Assembly]::LoadFile("$(Build.SourcesDirectory)/vscode-powershell/modules/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll")
85+
$assembly = [Reflection.Assembly]::LoadFile('$(Build.SourcesDirectory)/vscode-powershell/modules/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll')
8586
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
86-
Write-Host "##vso[task.LogIssue type=error;] PowerShell Editor Services bits were not built in release configuration!"
87+
Write-Host '##vso[task.LogIssue type=error;]PowerShell Editor Services bits were not built in release configuration!'
8788
exit 1
8889
}
8990
pwsh: ${{ parameters.pwsh }}

.vsts-ci/templates/publish-github.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ steps:
66
displayName: Download signed artifacts
77

88
- pwsh: |
9+
$PackageJson = Get-Content -Raw $(Build.SourcesDirectory)/package.json | ConvertFrom-Json
910
$(Build.SourcesDirectory)/tools/setupReleaseTools.ps1 -Token $(GitHubToken)
10-
New-DraftRelease -RepositoryName vscode-powershell -Assets $(Pipeline.Workspace)/vscode-powershell/powershell-*.vsix,$(Pipeline.Workspace)/vscode-powershell/Install-VSCode.ps1
11+
New-DraftRelease -RepositoryName vscode-powershell -Assets $(Pipeline.Workspace)/vscode-powershell/powershell-$($PackageJson.version).vsix,$(Pipeline.Workspace)/vscode-powershell/Install-VSCode.ps1
1112
displayName: Drafting a GitHub Release

.vsts-ci/templates/publish-markets.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@ steps:
77

88
- pwsh: |
99
npm ci --loglevel=error
10-
npm run publish -- --packagePath $(Pipeline.Workspace)/vscode-powershell/powershell-*.vsix --pat $(VsceToken)
10+
$PackageJson = Get-Content -Raw $(Build.SourcesDirectory)/package.json | ConvertFrom-Json
11+
$PublishArgs = @(
12+
if ($PackageJson.preview) { '--pre-release' }
13+
'--packagePath'
14+
"$(Pipeline.Workspace)/vscode-powershell/powershell-$($PackageJson.version).vsix"
15+
'--pat'
16+
'$(VsceToken)'
17+
)
18+
npm run publish -- @PublishArgs
1119
displayName: Publishing VSIX to VS Code Marketplace
1220

1321
# NOTE: We rarely update this script, so we can ignore errors from the gallery

0 commit comments

Comments
 (0)