8
8
# Support: https://aka.ms/onebranchsup #
9
9
# ################################################################################
10
10
11
- trigger : none
11
+ trigger :
12
+ - main
12
13
13
14
schedules :
14
15
- cron : ' 25 9 * * 3'
@@ -53,9 +54,10 @@ extends:
53
54
enabled : true
54
55
forStages : [build]
55
56
featureFlags :
57
+ EnableCDPxPAT : false
56
58
WindowsHostVersion :
57
59
Version : 2022
58
- Network : Netlock
60
+ Network : KS3
59
61
stages :
60
62
- stage : build
61
63
jobs :
@@ -81,6 +83,10 @@ extends:
81
83
inputs :
82
84
system : Custom
83
85
customVersion : $(package.version)
86
+ - task : UseNode@1
87
+ displayName : Use Node 20.x
88
+ inputs :
89
+ version : 20.x
84
90
- task : DownloadPipelineArtifact@2
85
91
displayName : Download PowerShellEditorServices
86
92
inputs :
@@ -93,9 +99,10 @@ extends:
93
99
targetPath : $(Build.SourcesDirectory)/modules
94
100
- pwsh : |
95
101
Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted
96
- Install-Module -Name InvokeBuild -Repository CFS -RequiredVersion 5.11.3 -Verbose
97
- Invoke-Build Build -Configuration $(BuildConfiguration)
98
- # TODO: When the OneBuild container updates to 7.4, update to PSResourceGet
102
+ Install-Module -Repository CFS -Name Microsoft.PowerShell.PSResourceGet
103
+ ./tools/installPSResources.ps1 -PSRepository CFS
104
+ displayName: Install PSResources
105
+ - pwsh : Invoke-Build Build -Configuration $(BuildConfiguration)
99
106
displayName : Build
100
107
- task : onebranch.pipeline.signing@1
101
108
displayName : Sign 1st-party example PowerShell files
@@ -106,6 +113,18 @@ extends:
106
113
files_to_sign : ' **/*.ps1;**/*.psd1;**/*.psm1'
107
114
- pwsh : Invoke-Build Package
108
115
displayName : Create package
116
+ - pwsh : |
117
+ npx vsce generate-manifest --packagePath out/powershell-$(package.vsixVersion).vsix
118
+ cp out/powershell-$(package.vsixVersion).manifest out/powershell-$(package.vsixVersion).signature.p7s
119
+ displayName: Generate VSIX manifest
120
+ - task : onebranch.pipeline.signing@1
121
+ displayName : Sign VSIX manifest
122
+ inputs :
123
+ command : sign
124
+ cp_code : ' CP-401405-VSCodePublisherSign'
125
+ search_root : $(Build.SourcesDirectory)/out
126
+ files_to_sign : |
127
+ *.signature.p7s;
109
128
- job : test
110
129
displayName : Build and run tests
111
130
pool :
@@ -118,19 +137,14 @@ extends:
118
137
skipComponentGovernanceDetection : true
119
138
steps :
120
139
- task : UseNode@1
121
- displayName : Use Node 18 .x
140
+ displayName : Use Node 20 .x
122
141
inputs :
123
- version : 18 .x
142
+ version : 20 .x
124
143
- task : UseDotNet@2
125
144
displayName : Use .NET 8.x SDK
126
145
inputs :
127
146
packageType : sdk
128
147
version : 8.x
129
- - task : PowerShell@2
130
- displayName : Install PSResources
131
- inputs :
132
- pwsh : true
133
- filePath : tools/installPSResources.ps1
134
148
- task : DownloadPipelineArtifact@2
135
149
displayName : Download PowerShellEditorServices
136
150
inputs :
@@ -141,11 +155,16 @@ extends:
141
155
branchName : refs/heads/main
142
156
artifact : drop_build_main
143
157
targetPath : $(Build.SourcesDirectory)/modules
158
+ - pwsh : |
159
+ Register-PSRepository -Name CFS -SourceLocation "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/nuget/v2" -InstallationPolicy Trusted
160
+ Install-Module -Repository CFS -Name Microsoft.PowerShell.PSResourceGet
161
+ ./tools/installPSResources.ps1 -PSRepository CFS
162
+ displayName: Install PSResources
144
163
- pwsh : Invoke-Build Test -Configuration $(BuildConfiguration)
145
164
displayName : Run tests
146
165
- stage : release
147
166
dependsOn : build
148
- condition : ne (variables['Build.Reason'], 'Schedule ')
167
+ condition : eq (variables['Build.Reason'], 'Manual ')
149
168
variables :
150
169
version : $[ stageDependencies.build.main.outputs['package.version'] ]
151
170
vsixVersion : $[ stageDependencies.build.main.outputs['package.vsixVersion'] ]
@@ -196,6 +215,10 @@ extends:
196
215
steps :
197
216
- download : current
198
217
displayName : Download artifacts
218
+ - task : UseNode@1
219
+ displayName : Use Node 20.x
220
+ inputs :
221
+ version : 20.x
199
222
- pwsh : npm ci
200
223
displayName : Install NPM packages (for vsce)
201
224
- task : AzureCLI@2
@@ -209,6 +232,10 @@ extends:
209
232
'--azure-credential'
210
233
'--packagePath'
211
234
'$(drop)/powershell-$(vsixVersion).vsix'
235
+ '--manifestPath'
236
+ '$(drop)/powershell-$(vsixVersion).manifest'
237
+ '--signaturePath'
238
+ '$(drop)/powershell-$(vsixVersion).signature.p7s'
212
239
if ([bool]::Parse('$(prerelease)')) { '--pre-release' }
213
240
)
214
241
npm run publish -- @publishArgs
0 commit comments