1
1
parameters :
2
- - name : pwsh
3
- type : boolean
4
- default : true
5
2
- name : usePipelineArtifact
6
3
type : boolean
7
4
default : false
@@ -34,11 +31,6 @@ steps:
34
31
archiveFilePatterns : $(Pipeline.Workspace)/PowerShellEditorServices.zip
35
32
destinationFolder : $(Build.SourcesDirectory)/vscode-powershell/modules
36
33
37
- - task : NodeTool@0
38
- displayName : Install Node.js
39
- inputs :
40
- versionSpec : 16.x
41
-
42
34
- task : UseDotNet@2
43
35
condition : not(${{ parameters.usePipelineArtifact }})
44
36
displayName : Install .NET 7.0.x SDK
@@ -55,53 +47,55 @@ steps:
55
47
version : 6.0.x
56
48
performMultiLevelLookup : true
57
49
58
- # The build script is always run with PowerShell Core
50
+ - task : UseNode@1
51
+ inputs :
52
+ version : 18.x
53
+
54
+ # We don't just use installPSResources.ps1 because we haven't always cloned PowerShellEditorServices
59
55
- task : PowerShell@2
60
56
displayName : Build and package
61
57
inputs :
62
58
targetType : inline
59
+ pwsh : true
63
60
script : |
64
- Install-Module InvokeBuild -Scope CurrentUser -Force
65
- Install-Module platyPS -Scope CurrentUser -Force
61
+ Install-Module -Name InvokeBuild -Scope CurrentUser -Force
62
+ Install-Module -Name platyPS -Scope CurrentUser
66
63
Invoke-Build -Configuration Release Package
67
64
$PackageJson = Get-Content -Raw package.json | ConvertFrom-Json
68
65
Write-Host "##vso[task.setvariable variable=vsixPath]$(Resolve-Path powershell-$($PackageJson.version).vsix)"
69
66
workingDirectory : $(Build.SourcesDirectory)/vscode-powershell
70
- pwsh : true
71
67
72
68
# Necessary on Linux to run VS Code unit tests
73
69
- bash : |
74
70
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
75
71
displayName : Start X virtual framebuffer
76
72
condition : and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
77
73
78
- # Tests in particular are run with either PowerShell Core or Windows PowerShell
79
74
- task : PowerShell@2
80
75
displayName : Run unit tests
81
76
inputs :
82
77
targetType : inline
78
+ pwsh : true
83
79
script : |
84
80
$PSVersionTable
85
81
Get-ChildItem env:
86
82
Get-Module -ListAvailable Pester
87
- Install-Module InvokeBuild -Scope CurrentUser -Force
88
83
Invoke-Build -Configuration Release Test
89
84
workingDirectory : $(Build.SourcesDirectory)/vscode-powershell
90
- pwsh : ${{ parameters.pwsh }}
91
85
env :
92
86
DISPLAY : ' :99.0'
93
87
94
88
- task : PowerShell@2
95
89
displayName : Assert PowerShellEditorServices release configuration
96
90
inputs :
97
91
targetType : inline
92
+ pwsh : true
98
93
script : |
99
94
$assembly = [Reflection.Assembly]::LoadFile('$(Build.SourcesDirectory)/vscode-powershell/modules/PowerShellEditorServices.VSCode/bin/Microsoft.PowerShell.EditorServices.VSCode.dll')
100
95
if ($assembly.GetCustomAttributes([System.Diagnostics.DebuggableAttribute], $true).IsJITOptimizerDisabled) {
101
96
Write-Host '##vso[task.LogIssue type=error;]PowerShell Editor Services bits were not built in release configuration!'
102
97
exit 1
103
98
}
104
- pwsh : true
105
99
106
100
- publish : $(vsixPath)
107
101
artifact : vscode-powershell-vsix-$(System.JobId)
0 commit comments