Skip to content

Commit

Permalink
Add the release stage to the pipeline and exclude test folders from C…
Browse files Browse the repository at this point in the history
…omponent Governance (#3982)
  • Loading branch information
daxian-dbw committed Apr 2, 2024
1 parent b162aef commit d7fe398
Showing 1 changed file with 60 additions and 1 deletion.
61 changes: 60 additions & 1 deletion .pipelines/PSReadLine-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ extends:
WindowsHostVersion: '1ESWindows2022'
globalSdl:
disableLegacyManifest: true
cg: # Component Governance parameters. Ignore test components.
ignoreDirectories: $(Build.SourcesDirectory)\PSReadLine\MockPSConsole,$(Build.SourcesDirectory)\PSReadLine\test
sbom:
enabled: true
packageName: PSReadLine
buildComponentPath: $(Build.SourcesDirectory)\PSReadLine\PSReadLine
codeql:
compiled:
enabled: true
Expand All @@ -43,7 +46,7 @@ extends:
forStages: [Build]
credscan:
enabled: true
scanFolder: $(Build.SourcesDirectory)\PSReadLine\PSReadLine
scanFolder: $(Build.SourcesDirectory)\PSReadLine\PSReadLine
binskim:
enabled: true
apiscan:
Expand Down Expand Up @@ -235,3 +238,59 @@ extends:
SourceFolder: $(nugetPath)
Contents: '**\*'
TargetFolder: $(ob_outputDirectory)

- stage: release
dependsOn: buildstage
displayName: Release PSReadLine

jobs:
- job: validation
displayName: Manual validation
pool:
type: agentless
timeoutInMinutes: 1440

steps:
- task: ManualValidation@0
displayName: Wait 24 hours for validation
inputs:
instructions: Please validate the release
timeoutInMinutes: 1440

- job: publish
dependsOn: validation
displayName: Publish to AzFeed and PSGallery
variables:
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
- name: nugetPath
value: $(Pipeline.Workspace)\NuGetPackage
pool:
type: windows

steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download nupkg artifact'
inputs:
targetPath: $(nugetPath)
artifact: drop_buildstage_nupkg

- pwsh: |
Get-ChildItem $(nugetPath) -Recurse
displayName: Find signed Nupkg
- task: NuGetCommand@2
displayName: Push PSReadLine module to Azure feed
inputs:
command: push
packagesToPush: $(nugetPath)\PSReadLine.*.nupkg
nuGetFeedType: internal
publishVstsFeed: AzArtifactsFeed

- task: NuGetCommand@2
displayName: Push PSReadLine module to PSGallery feed
inputs:
command: push
packagesToPush: $(nugetPath)\PSReadLine.*.nupkg
nuGetFeedType: external
publishFeedCredentials: PowerShellGalleryFeed

0 comments on commit d7fe398

Please sign in to comment.