Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 1000

Expand All @@ -43,7 +43,7 @@ jobs:
}

- name: Upload test results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: test-results-${{ matrix.os }}
Expand All @@ -56,7 +56,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 1000

Expand All @@ -80,7 +80,7 @@ jobs:
}

- name: Upload test results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
if: always()
with:
name: windows-powershell-test-results
Expand Down
56 changes: 54 additions & 2 deletions Archive-Release-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ parameters: # parameters are shown up in ADO UI in a build queue time
displayName: 'Enable debug output'
type: boolean
default: false
- name: 'releaseCFS'
displayName: 'Publish to CFS feed'
type: boolean
default: false
- name: 'releasePSGallery'
displayName: 'Publish to PSGallery'
type: boolean
default: false

variables:
- name: DOTNET_CLI_TELEMETRY_OPTOUT
Expand Down Expand Up @@ -160,9 +168,53 @@ extends: # Governed template expands from here which defines over all pipeline
Contents: $(publishPath)\Microsoft.PowerShell.Archive.*.nupkg
TargetFolder: $(ob_outputDirectory)

- stage: releaseCFS
displayName: 'Publish Package to CFS feed'
dependsOn: stagebuild
condition: and(succeeded(), ${{ eq(parameters.releaseCFS, true) }})
jobs:
- job: releaseCFSJob
displayName: Publish to CFS feed
variables:
- name: ob_outputDirectory
value: '$(Build.ArtifactStagingDirectory)/ONEBRANCH_ARTIFACT'
pool:
type: windows
steps:
- task: DownloadPipelineArtifact@2
inputs:
targetPath: '$(Pipeline.Workspace)'
artifact: drop_stagebuild_jobbuild
displayName: 'Download drop_stagebuild_jobbuild artifact that has .nupkg file needed'
- pwsh: |
Get-ChildItem '$(Pipeline.Workspace)' -Recurse | Out-String -Stream | write-Verbose -Verbose
displayName: 'Capture Workspace'
- pwsh: |
$publishNupkg = Get-ChildItem -Path '$(Pipeline.Workspace)\Microsoft.PowerShell.Archive\signed\PublishedNupkg\Microsoft.PowerShell.Archive.*.nupkg' -Recurse -File | Select-Object -First 1
$pkgFound = Test-Path $publishNupkg
Write-Verbose -Verbose "pkg found: $pkgFound"
displayName: 'Verify downloaded .nupkg is present'
- task: NuGetAuthenticate@1
displayName: 'Authenticate to external Azure Artifacts feed'
inputs:
azureDevOpsServiceConnection: 'mscodehub-PushToPSRelFeed-ADO'
feedUrl: 'https://pkgs.dev.azure.com/powershell-rel/PowerShell/_packaging/powershell-module-earlyaccess/nuget/v3/index.json'
- pwsh: |
$publishNupkg = Get-ChildItem -Path '$(Pipeline.Workspace)\Microsoft.PowerShell.Archive\signed\PublishedNupkg\Microsoft.PowerShell.Archive.*.nupkg' -Recurse -File | Select-Object -First 1
if (-not $publishNupkg)
{
throw "No nupkg found under $(Pipeline.Workspace) matching Microsoft.PowerShell.Archive.*.nupkg"
}
$publishNupkgPath = $publishNupkg.FullName
Write-Verbose -Verbose "Package found at path: $publishNupkgPath"
$adoRepoUri = "https://pkgs.dev.azure.com/powershell-rel/PowerShell/_packaging/powershell-module-earlyaccess/nuget/v3/index.json"
dotnet nuget push $publishNupkgPath --source $adoRepoUri --api-key az --skip-duplicate
displayName: 'Push package to external Azure Artifacts feed'

- stage: release
displayName: Release Microsoft.PowerShell.Archive
dependsOn: stagebuild
condition: and(succeeded(), ${{ eq(parameters.releasePSGallery, true) }})
variables:
version: $[ stageDependencies.build.main.outputs['package.version'] ]
drop: $(Pipeline.Workspace)/drop_stagebuild_jobbuild
Expand All @@ -173,13 +225,13 @@ extends: # Governed template expands from here which defines over all pipeline
displayName: Manual validation
pool:
type: server
timeoutInMinutes: 1440
timeoutInMinutes: 14400
steps:
- task: ManualValidation@0
displayName: Wait 24 hours for validation
inputs:
instructions: Please validate the release
timeoutInMinutes: 1440
timeoutInMinutes: 14400

- job: PSGalleryPublish
displayName: Publish to PSGallery
Expand Down
Loading