@@ -18,18 +18,29 @@ parameters:
18
18
19
19
variables :
20
20
system.debug : ${{ parameters.debug }}
21
+ BuildConfiguration : Release
21
22
WindowsContainerImage : onebranch.azurecr.io/windows/ltsc2019/vse2022:latest
22
23
23
24
resources :
24
- repositories :
25
+ repositories :
25
26
- repository : templates
26
27
type : git
27
28
name : OneBranch.Pipelines/GovernedTemplates
28
29
ref : refs/heads/main
30
+ - repository : PowerShellEditorServices
31
+ type : git
32
+ name : PowerShellEditorServices
33
+ ref : release
34
+ pipelines :
35
+ - pipeline : PowerShellEditorServices-Official
36
+ source : PowerShellEditorServices-Official
37
+ trigger :
38
+ branches :
39
+ - release
29
40
30
41
extends :
31
42
# https://aka.ms/obpipelines/templates
32
- template : v2/OneBranch.Official.CrossPlat.yml@templates
43
+ template : v2/OneBranch.Official.CrossPlat.yml@templates
33
44
parameters :
34
45
globalSdl : # https://aka.ms/obpipelines/sdl
35
46
asyncSdl :
@@ -45,7 +56,10 @@ extends:
45
56
variables :
46
57
ob_outputDirectory : $(Build.SourcesDirectory)/out
47
58
steps :
48
- - pwsh : Write-Output "##vso[task.setvariable variable=version;isOutput=true]$((Get-Content -Raw -Path package.json | ConvertFrom-Json).version)"
59
+ - pwsh : |
60
+ [semver]$version = (Get-Content -Raw -Path package.json | ConvertFrom-Json).version
61
+ Write-Output "##vso[task.setvariable variable=version;isOutput=true]$version"
62
+ Write-Output "##vso[task.setvariable variable=prerelease;isOutput=true]$($version.Minor % 2 -ne 0)"
49
63
name: package
50
64
displayName: Get version from package.json
51
65
- task : onebranch.pipeline.version@1
@@ -61,18 +75,42 @@ extends:
61
75
displayName : Authenticate NPM with Azure Artifacts
62
76
inputs :
63
77
workingFile : .npmrc
64
- - pwsh : npm ci
65
- displayName : Install NPM packages
66
- - pwsh : npm run compile -- --minify
67
- displayName : Build minified extension
78
+ - task : PowerShell@2
79
+ displayName : Install PSResources
80
+ inputs :
81
+ pwsh : true
82
+ filePath : tools/installPSResources.ps1
83
+ - task : DownloadPipelineArtifact@2
84
+ displayName : Download PowerShellEditorServices
85
+ inputs :
86
+ source : specific
87
+ project : PowerShellCore
88
+ definition : 2905
89
+ specificBuildWithTriggering : true
90
+ artifact : drop_release_github
91
+ itemPattern : PowerShellEditorServices.zip
92
+ - task : ExtractFiles@1
93
+ displayName : Extract PowerShellEditorServices module
94
+ inputs :
95
+ archiveFilePatterns : $(Pipeline.Workspace)/PowerShellEditorServices.zip
96
+ destinationFolder : $(Build.SourcesDirectory)/modules
97
+ - pwsh : Invoke-Build Build -Configuration $(BuildConfiguration)
98
+ displayName : Build
68
99
- task : onebranch.pipeline.signing@1
69
- displayName : Sign 1st-party files
100
+ displayName : Sign 1st-party extension files
70
101
inputs :
71
102
command : sign
72
103
signing_environment : external_distribution
73
104
search_root : $(Build.SourcesDirectory)/dist
74
- files_to_sign : extension.js
75
- - pwsh : New-Item -ItemType Directory -Force out && npm run package -- --out out/
105
+ files_to_sign : ' **/*.js'
106
+ - task : onebranch.pipeline.signing@1
107
+ displayName : Sign 1st-party example files
108
+ inputs :
109
+ command : sign
110
+ signing_environment : external_distribution
111
+ search_root : $(Build.SourcesDirectory)/examples
112
+ files_to_sign : ' **/*.js;**/*.ps1;**/*.psd1;**/*.psm1'
113
+ - pwsh : Invoke-Build Package
76
114
displayName : Create package
77
115
- job : test
78
116
displayName : Build and run tests
@@ -85,22 +123,34 @@ extends:
85
123
ob_outputDirectory : $(Build.SourcesDirectory)/out
86
124
skipComponentGovernanceDetection : true
87
125
steps :
126
+ - checkout : self
127
+ - checkout : PowerShellEditorServices
88
128
- task : UseNode@1
89
129
displayName : Use Node 18.x
90
130
inputs :
91
131
version : 18.x
92
132
- task : npmAuthenticate@0
93
133
displayName : Authenticate NPM with Azure Artifacts
94
134
inputs :
95
- workingFile : .npmrc
96
- - pwsh : npm ci
97
- displayName : Install NPM packages
98
- - pwsh : npm run test
135
+ workingFile : vscode-powershell/.npmrc
136
+ - task : UseDotNet@2
137
+ displayName : Use .NET 8.x SDK
138
+ inputs :
139
+ packageType : sdk
140
+ version : 8.x
141
+ - task : PowerShell@2
142
+ displayName : Install PSResources
143
+ inputs :
144
+ pwsh : true
145
+ filePath : vscode-powershell/tools/installPSResources.ps1
146
+ - pwsh : Invoke-Build Test -Configuration $(BuildConfiguration)
99
147
displayName : Run tests
148
+ workingDirectory : vscode-powershell
100
149
- stage : release
101
150
dependsOn : build
102
151
variables :
103
152
version : $[ stageDependencies.build.main.outputs['package.version'] ]
153
+ prerelease : $[ stageDependencies.build.main.outputs['package.prerelease'] ]
104
154
drop : $(Pipeline.Workspace)/drop_build_main
105
155
jobs :
106
156
- job : validation
@@ -116,7 +166,7 @@ extends:
116
166
instructions : Please validate the release
117
167
timeoutInMinutes : 1440
118
168
- job : github
119
- dependsOn : validation
169
+ # TODO: dependsOn: validation
120
170
displayName : Publish draft to GitHub
121
171
pool :
122
172
type : windows
@@ -129,11 +179,12 @@ extends:
129
179
displayName : Create GitHub release
130
180
inputs :
131
181
gitHubConnection : GitHub
132
- repositoryName : microsoft /vscode-azurearcenabledmachines
133
- assets : $(drop)/vscode-azurearcenabledmachines -$(version).vsix
182
+ repositoryName : PowerShell /vscode-powershell
183
+ assets : $(drop)/vscode-powershell -$(version).vsix
134
184
tagSource : userSpecifiedTag
135
185
tag : v$(version)
136
186
isDraft : true
187
+ isPreRelease : $(prerelease)
137
188
addChangeLog : false
138
189
releaseNotesSource : inline
139
190
releaseNotesInline : |
@@ -156,5 +207,13 @@ extends:
156
207
workingFile : .npmrc
157
208
- pwsh : npm ci
158
209
displayName : Install NPM packages (for vsce)
159
- - pwsh : npm run publish -- --pat $(token) --packagePath $(drop)/vscode-azurearcenabledmachines-$(version).vsix
210
+ - pwsh : |
211
+ $publishArgs = @(
212
+ '--pat'
213
+ '$(token)'
214
+ '--packagePath'
215
+ '$(drop)/vscode-powershell-$(version).vsix'
216
+ if ([bool]::Parse('$(prerelease)')) { '--pre-release' }
217
+ )
218
+ npm run publish -- @publishArgs
160
219
displayName: Run vsce publish
0 commit comments