Skip to content

[release/v7.5.9] Separate NuGet publish into its own stage after pushing the git tag#27650

Open
SeeminglyScience wants to merge 1 commit into
PowerShell:release/v7.5.9from
SeeminglyScience:backport/release/v7.5.9/27611-36cd02b33
Open

[release/v7.5.9] Separate NuGet publish into its own stage after pushing the git tag#27650
SeeminglyScience wants to merge 1 commit into
PowerShell:release/v7.5.9from
SeeminglyScience:backport/release/v7.5.9/27611-36cd02b33

Conversation

@SeeminglyScience

Copy link
Copy Markdown
Contributor

Backport of #27611 to release/v7.5.9

Triggered by @SeeminglyScience on behalf of @jshigetomi

Original CL Label: CL-BuildPackaging

/cc @PowerShell/powershell-maintainers

Impact

REQUIRED: Choose either Tooling Impact or Customer Impact (or both). At least one checkbox must be selected.

Tooling Impact

  • Required tooling change
  • Optional tooling change (include reasoning)

Separates NuGet publishing into a dedicated stage that runs after the git tag is pushed and the GitHub draft is made public. This ensures correct release sequencing and makes the pipeline more modular.

Customer Impact

  • Customer reported
  • Found internally

Regression

REQUIRED: Check exactly one box.

  • Yes
  • No

This is not a regression.

Testing

This is a release pipeline structural change that can only be validated in an actual release run. The same change was successfully backported to v7.4.x via #27648. No unit tests are applicable for Azure DevOps pipeline YAML changes.

Risk

REQUIRED: Check exactly one box.

  • High
  • Medium
  • Low

Separates previously combined GitHub and NuGet release stages into distinct stages for correct ordering and modularity. The logic itself is unchanged — only the pipeline structure is refactored. Successfully applied to 7.4.x already.

…owerShell#27611)

Co-authored-by: Justin Chung <chungjustin@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings July 2, 2026 17:49
@SeeminglyScience SeeminglyScience requested a review from a team as a code owner July 2, 2026 17:49
@SeeminglyScience SeeminglyScience added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Jul 2, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors the release pipeline on release/v7.5.9 to ensure NuGet publishing happens only after the git tag is pushed and the GitHub draft release is made public, by splitting previously combined release responsibilities into separate stages/templates.

Changes:

  • Split the prior combined GitHub+NuGet publishing stage into separate PublishGitHubRelease and PublishNugetRelease stages with updated dependencies/order.
  • Introduce a dedicated NuGet publishing template (release-Nuget.yml) and remove NuGet publishing from the GitHub release template.
  • Remove the Windows packages manual validation approval job from the ManualValidation stage.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
.pipelines/templates/stages/PowerShell-Release-Stages.yml Rewires release stages to separate GitHub vs NuGet publishing and adjust stage dependencies/order; also removes Windows manual validation job.
.pipelines/templates/release-Nuget.yml New standalone NuGet publishing job template (downloads packages and pushes to NuGet).
.pipelines/templates/release-github.yml Removes the embedded NuGet publishing job so this template only creates the GitHub release draft.

Comment on lines +50 to +54
condition: and(ne('${{ parameters.skipPublish }}', 'true'), succeeded())

- task: NuGetCommand@2
displayName: 'NuGet push'
condition: and(ne('${{ parameters.skipPublish }}', 'true'), succeeded())
targetType: inline
script: |
#Exclude all global tool packages. Their names start with 'PowerShell.'
$null = New-Item -ItemType Directory -Path "$(Pipeline.Workspace)/release"
Comment on lines +42 to +45
if ($releaseVersion -notlike '*-*') {
# Copy the global tool package for stable releases
Copy-Item $globalToolPath -Destination "$(Pipeline.Workspace)/release"
}
Make the GitHub Release Draft Public

- stage: PublishNugetRelease
displayName: Publish Nuget Release
Comment on lines 99 to 103
- stage: ManualValidation
dependsOn: []
displayName: Manual Validation
jobs:
- template: /.pipelines/templates/approvalJob.yml@self
parameters:
displayName: Validate Windows Packages
jobName: ValidateWinPkg
instructions: |
Validate zip package on windows

- template: /.pipelines/templates/approvalJob.yml@self
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants