@@ -29,7 +29,7 @@ variables:
29
29
value : onebranch.azurecr.io/windows/ltsc2022/vse2022:latest # Docker image which is used to build the project https://aka.ms/obpipelines/containers
30
30
31
31
resources :
32
- repositories :
32
+ repositories :
33
33
- repository : onebranchTemplates
34
34
type : git
35
35
name : OneBranch.Pipelines/GovernedTemplates
@@ -41,6 +41,8 @@ extends:
41
41
featureFlags :
42
42
WindowsHostVersion : ' 1ESWindows2022'
43
43
customTags : ' ES365AIMigrationTooling'
44
+ release :
45
+ category : NonAzure
44
46
globalSdl :
45
47
disableLegacyManifest : true
46
48
sbom :
@@ -58,7 +60,7 @@ extends:
58
60
binskim :
59
61
enabled : true
60
62
apiscan :
61
- enabled : false
63
+ enabled : false
62
64
63
65
stages :
64
66
- stage : stagebuild
@@ -125,15 +127,6 @@ extends:
125
127
AnalyzeInPipeline : true
126
128
Language : csharp
127
129
128
- - pwsh : |
129
- $module = 'Microsoft.PowerShell.PSResourceGet'
130
- Write-Verbose "installing $module..." -verbose
131
- $ProgressPreference = 'SilentlyContinue'
132
- Install-Module $module -AllowClobber -Force
133
- displayName: Install PSResourceGet 0.9.0 or above for build.psm1
134
- env:
135
- ob_restore_phase: true # Set ob_restore_phase to run this step before '🔒 Setup Signing' step.
136
-
137
130
# this is installing .NET
138
131
- pwsh : |
139
132
Set-Location "$(repoRoot)"
@@ -167,14 +160,14 @@ extends:
167
160
}
168
161
}
169
162
displayName: Find all 3rd party files that need to be signed
170
-
163
+
171
164
- task : onebranch.pipeline.signing@1
172
165
displayName : Sign 3rd Party files
173
166
inputs :
174
167
command : ' sign'
175
168
signing_profile : 135020002
176
169
files_to_sign : ' *.dll'
177
- search_root : $(signSrcPath)/Microsoft.PowerShell.PSResourceGet/UnsignedDependencies
170
+ search_root : $(signSrcPath)/Microsoft.PowerShell.PSResourceGet/UnsignedDependencies
178
171
179
172
- pwsh : |
180
173
$newlySignedDepsPath = Join-Path -Path $(signSrcPath) -ChildPath "Microsoft.PowerShell.PSResourceGet" -AdditionalChildPath "UnsignedDependencies"
@@ -216,7 +209,7 @@ extends:
216
209
value : $(Build.SourcesDirectory)\PSResourceGet\.config\tsaoptions.json
217
210
# Disable because SBOM was already built in the previous job
218
211
- name : ob_sdl_sbom_enabled
219
- value : false
212
+ value : true
220
213
- name : signOutPath
221
214
value : $(repoRoot)/signed
222
215
- name : ob_signing_setup_enabled
@@ -250,15 +243,12 @@ extends:
250
243
displayName: Capture artifacts directory structure
251
244
252
245
- pwsh : |
253
- $module = 'Microsoft.PowerShell.PSResourceGet'
254
- Write-Verbose "installing $module..." -verbose
255
- $ProgressPreference = 'SilentlyContinue'
256
- Install-Module $module -AllowClobber -Force
257
- displayName: Install PSResourceGet 0.9.0 or above for build.psm1
246
+ # This need to be done before set-location so the module from PSHome is loaded
247
+ Import-Module -Name Microsoft.PowerShell.PSResourceGet -Force
258
248
259
- - pwsh : |
260
249
Set-Location "$(signOutPath)\Microsoft.PowerShell.PSResourceGet"
261
- New-Item -ItemType Directory -Path "$(signOutPath)\PublishedNupkg" -Force
250
+ $null = New-Item -ItemType Directory -Path "$(signOutPath)\PublishedNupkg" -Force
251
+
262
252
Register-PSResourceRepository -Name 'localRepo' -Uri "$(signOutPath)\PublishedNupkg"
263
253
Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose
264
254
displayName: Create nupkg for publishing
@@ -274,61 +264,65 @@ extends:
274
264
- pwsh : |
275
265
Set-Location "$(signOutPath)\PublishedNupkg"
276
266
Write-Host "Contents of signOutPath:"
277
- Get-ChildItem "$(signOutPath)" -Recurse
267
+ Get-ChildItem "$(signOutPath)" -Recurse
278
268
displayName: Find Nupkg
279
269
280
270
- task : CopyFiles@2
281
271
displayName : " Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'"
282
272
inputs :
283
273
Contents : $(signOutPath)\PublishedNupkg\Microsoft.PowerShell.PSResourceGet.*.nupkg
284
274
TargetFolder : $(ob_outputDirectory)
285
-
275
+
286
276
- pwsh : |
287
277
Write-Host "Contents of ob_outputDirectory:"
288
- Get-ChildItem "$(ob_outputDirectory)" -Recurse
278
+ Get-ChildItem "$(ob_outputDirectory)" -Recurse
289
279
displayName: Find Signed Nupkg
290
280
291
281
- stage : release
292
282
displayName : Release PSResourceGet
293
283
dependsOn : stagebuild
294
284
variables :
295
285
version : $[ stageDependencies.build.main.outputs['package.version'] ]
296
- drop : $(Pipeline.Workspace)/drop_build_main
286
+ drop : $(Pipeline.Workspace)/drop_stagebuild_nupkg
287
+ ob_release_environment : ' Production'
288
+
297
289
jobs :
298
290
- job : validation
299
291
displayName : Manual validation
300
292
pool :
301
- type : agentless
293
+ type : server
302
294
timeoutInMinutes : 1440
303
295
steps :
304
296
- task : ManualValidation@0
305
297
displayName : Wait 24 hours for validation
306
298
inputs :
307
299
instructions : Please validate the release
308
300
timeoutInMinutes : 1440
301
+
309
302
- job : PSGalleryPublish
310
303
displayName : Publish to PSGallery
311
304
dependsOn : validation
305
+ templateContext :
306
+ inputs :
307
+ - input : pipelineArtifact
308
+ artifactName : drop_stagebuild_nupkg
312
309
pool :
313
- type : windows
310
+ type : release
311
+ os : windows
314
312
variables :
315
313
ob_outputDirectory : ' $(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
316
314
steps :
317
- - download : current
318
- displayName : Download artifact
319
-
320
- - pwsh : |
321
- Get-ChildItem $(Pipeline.Workspace) -Recurse
322
- displayName: Capture environment
323
-
324
- - pwsh : |
325
- Get-ChildItem "$(Pipeline.Workspace)/drop_stagebuild_nupkg" -Recurse
315
+ - task : PowerShell@2
316
+ inputs :
317
+ targetType : ' inline'
318
+ script : |
319
+ Get-ChildItem "$(Pipeline.Workspace)/" -Recurse
326
320
displayName : Find signed Nupkg
327
321
328
322
- task : NuGetCommand@2
329
323
displayName : Push PowerShellGet module artifacts to PSGallery feed
330
324
inputs :
331
325
command : push
332
- packagesToPush : ' $(Pipeline.Workspace)\drop_stagebuild_nupkg\ PSResourceGet\signed\PublishedNupkg\Microsoft.PowerShell.PSResourceGet.*.nupkg'
326
+ packagesToPush : ' $(Pipeline.Workspace)\PSResourceGet\signed\PublishedNupkg\Microsoft.PowerShell.PSResourceGet.*.nupkg'
333
327
nuGetFeedType : external
334
328
publishFeedCredentials : PSGet-PSGalleryPush
0 commit comments