Skip to content

Commit 3d28e75

Browse files
committed
Merge branch 'master' of https://github.com/PowerShell/PSResourceGet into awsteam-requiredresdep
2 parents 4e67478 + 6915968 commit 3d28e75

7 files changed

+386
-72
lines changed

.pipelines/PSResourceGet-Official.yml

+31-37
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ variables:
2929
value: onebranch.azurecr.io/windows/ltsc2022/vse2022:latest # Docker image which is used to build the project https://aka.ms/obpipelines/containers
3030

3131
resources:
32-
repositories:
32+
repositories:
3333
- repository: onebranchTemplates
3434
type: git
3535
name: OneBranch.Pipelines/GovernedTemplates
@@ -41,6 +41,8 @@ extends:
4141
featureFlags:
4242
WindowsHostVersion: '1ESWindows2022'
4343
customTags: 'ES365AIMigrationTooling'
44+
release:
45+
category: NonAzure
4446
globalSdl:
4547
disableLegacyManifest: true
4648
sbom:
@@ -58,7 +60,7 @@ extends:
5860
binskim:
5961
enabled: true
6062
apiscan:
61-
enabled: false
63+
enabled: false
6264

6365
stages:
6466
- stage: stagebuild
@@ -125,15 +127,6 @@ extends:
125127
AnalyzeInPipeline: true
126128
Language: csharp
127129

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-
137130
# this is installing .NET
138131
- pwsh: |
139132
Set-Location "$(repoRoot)"
@@ -167,14 +160,14 @@ extends:
167160
}
168161
}
169162
displayName: Find all 3rd party files that need to be signed
170-
163+
171164
- task: onebranch.pipeline.signing@1
172165
displayName: Sign 3rd Party files
173166
inputs:
174167
command: 'sign'
175168
signing_profile: 135020002
176169
files_to_sign: '*.dll'
177-
search_root: $(signSrcPath)/Microsoft.PowerShell.PSResourceGet/UnsignedDependencies
170+
search_root: $(signSrcPath)/Microsoft.PowerShell.PSResourceGet/UnsignedDependencies
178171

179172
- pwsh: |
180173
$newlySignedDepsPath = Join-Path -Path $(signSrcPath) -ChildPath "Microsoft.PowerShell.PSResourceGet" -AdditionalChildPath "UnsignedDependencies"
@@ -216,7 +209,7 @@ extends:
216209
value: $(Build.SourcesDirectory)\PSResourceGet\.config\tsaoptions.json
217210
# Disable because SBOM was already built in the previous job
218211
- name: ob_sdl_sbom_enabled
219-
value: false
212+
value: true
220213
- name: signOutPath
221214
value: $(repoRoot)/signed
222215
- name: ob_signing_setup_enabled
@@ -250,15 +243,12 @@ extends:
250243
displayName: Capture artifacts directory structure
251244
252245
- 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
258248
259-
- pwsh: |
260249
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+
262252
Register-PSResourceRepository -Name 'localRepo' -Uri "$(signOutPath)\PublishedNupkg"
263253
Publish-PSResource -Path "$(signOutPath)\Microsoft.PowerShell.PSResourceGet" -Repository 'localRepo' -Verbose
264254
displayName: Create nupkg for publishing
@@ -274,61 +264,65 @@ extends:
274264
- pwsh: |
275265
Set-Location "$(signOutPath)\PublishedNupkg"
276266
Write-Host "Contents of signOutPath:"
277-
Get-ChildItem "$(signOutPath)" -Recurse
267+
Get-ChildItem "$(signOutPath)" -Recurse
278268
displayName: Find Nupkg
279269
280270
- task: CopyFiles@2
281271
displayName: "Copy nupkg to ob_outputDirectory - '$(ob_outputDirectory)'"
282272
inputs:
283273
Contents: $(signOutPath)\PublishedNupkg\Microsoft.PowerShell.PSResourceGet.*.nupkg
284274
TargetFolder: $(ob_outputDirectory)
285-
275+
286276
- pwsh: |
287277
Write-Host "Contents of ob_outputDirectory:"
288-
Get-ChildItem "$(ob_outputDirectory)" -Recurse
278+
Get-ChildItem "$(ob_outputDirectory)" -Recurse
289279
displayName: Find Signed Nupkg
290280
291281
- stage: release
292282
displayName: Release PSResourceGet
293283
dependsOn: stagebuild
294284
variables:
295285
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+
297289
jobs:
298290
- job: validation
299291
displayName: Manual validation
300292
pool:
301-
type: agentless
293+
type: server
302294
timeoutInMinutes: 1440
303295
steps:
304296
- task: ManualValidation@0
305297
displayName: Wait 24 hours for validation
306298
inputs:
307299
instructions: Please validate the release
308300
timeoutInMinutes: 1440
301+
309302
- job: PSGalleryPublish
310303
displayName: Publish to PSGallery
311304
dependsOn: validation
305+
templateContext:
306+
inputs:
307+
- input: pipelineArtifact
308+
artifactName: drop_stagebuild_nupkg
312309
pool:
313-
type: windows
310+
type: release
311+
os: windows
314312
variables:
315313
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
316314
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
326320
displayName: Find signed Nupkg
327321

328322
- task: NuGetCommand@2
329323
displayName: Push PowerShellGet module artifacts to PSGallery feed
330324
inputs:
331325
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'
333327
nuGetFeedType: external
334328
publishFeedCredentials: PSGet-PSGalleryPush

0 commit comments

Comments
 (0)