@@ -12,6 +12,11 @@ name: PSReadLine-ModuleBuild-$(Build.BuildId)
12
12
trigger : none
13
13
pr : none
14
14
15
+ parameters :
16
+ - name : Release
17
+ type : boolean
18
+ default : true # Set false to skip release stage
19
+
15
20
variables :
16
21
DOTNET_CLI_TELEMETRY_OPTOUT : 1
17
22
POWERSHELL_TELEMETRY_OPTOUT : 1
@@ -28,9 +33,12 @@ resources:
28
33
extends :
29
34
template : v2/OneBranch.Official.CrossPlat.yml@templates
30
35
parameters :
36
+ release :
37
+ category : NonAzure
31
38
featureFlags :
32
39
WindowsHostVersion :
33
40
Version : 2022
41
+ Network : Netlock
34
42
globalSdl :
35
43
disableLegacyManifest : true
36
44
cg : # Component Governance parameters. Ignore test components.
@@ -93,11 +101,19 @@ extends:
93
101
# Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
94
102
ob_restore_phase: true
95
103
104
+ - task : UseDotNet@2
105
+ displayName : Bootstrap - install .NET
106
+ env :
107
+ # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
108
+ ob_restore_phase : true
109
+ inputs :
110
+ packageType : sdk
111
+
96
112
- pwsh : |
97
113
Write-Host "PS Version: $($PSVersionTable.PSVersion)"
98
- Set-Location -Path '$(repoRoot)'
99
- .\build.ps1 -Bootstrap
100
- displayName: Bootstrap
114
+ Register-PSResourceRepository -Name CFS -Uri "https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/PowerShellGalleryMirror/nuget/v3/index.json" -Trusted
115
+ Install-PSResource -Repository CFS -Name InvokeBuild -Version 5.12.1 -Verbose
116
+ displayName: Bootstrap - install InvokeBuild
101
117
env:
102
118
# Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
103
119
ob_restore_phase: true
@@ -184,9 +200,8 @@ extends:
184
200
value : $(Build.SourcesDirectory)\PSReadLine
185
201
- name : ob_sdl_tsa_configFile
186
202
value : $(repoRoot)\.config\tsaoptions.json
187
- # Disable because SBOM was already built in the previous job
188
203
- name : ob_sdl_sbom_enabled
189
- value : false
204
+ value : true
190
205
- name : signOutPath
191
206
value : $(repoRoot)\signed\PSReadLine
192
207
- name : nugetPath
@@ -254,12 +269,14 @@ extends:
254
269
- stage : release
255
270
dependsOn : buildstage
256
271
displayName : Release PSReadLine
272
+ variables :
273
+ ob_release_environment : Production
257
274
258
275
jobs :
259
276
- job : validation
260
277
displayName : Manual validation
261
278
pool :
262
- type : agentless
279
+ type : server
263
280
timeoutInMinutes : 1440
264
281
265
282
steps :
@@ -272,36 +289,37 @@ extends:
272
289
- job : publish
273
290
dependsOn : validation
274
291
displayName : Publish to PSGallery
292
+ pool :
293
+ type : release
294
+ os : windows
295
+ templateContext :
296
+ inputs :
297
+ - input : pipelineArtifact
298
+ artifactName : drop_buildstage_nupkg
275
299
variables :
276
300
- name : ob_outputDirectory
277
301
value : ' $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
278
- - name : nugetPath
279
- value : $(Pipeline.Workspace)\NuGetPackage
280
302
# Disable SBOM, signing, and codeQL for this job
281
303
- name : ob_sdl_sbom_enabled
282
304
value : false
283
305
- name : ob_signing_setup_enabled
284
306
value : false
285
307
- name : ob_sdl_codeql_compiled_enabled
286
308
value : false
287
- pool :
288
- type : windows
289
309
290
310
steps :
291
- - task : DownloadPipelineArtifact@2
292
- displayName : ' Download nupkg artifact'
311
+ - task : PowerShell@2
293
312
inputs :
294
- targetPath : $(nugetPath)
295
- artifact : drop_buildstage_nupkg
296
-
297
- - pwsh : |
298
- Get-ChildItem $(nugetPath) -Recurse | Out-String -Width 120 -Stream
313
+ targetType : ' inline'
314
+ script : |
315
+ Get-ChildItem $(Pipeline.Workspace) -Recurse | Out-String -Width 120 -Stream
299
316
displayName : Find signed Nupkg
300
317
301
318
- task : NuGetCommand@2
319
+ condition : ${{ parameters.Release }}
302
320
displayName : Push PSReadLine module to PSGallery feed
303
321
inputs :
304
322
command : push
305
- packagesToPush : $(nugetPath )\PSReadLine.*.nupkg
323
+ packagesToPush : $(Pipeline.Workspace )\PSReadLine.*.nupkg
306
324
nuGetFeedType : external
307
325
publishFeedCredentials : PowerShellGalleryFeed
0 commit comments