Skip to content

Separate NuGet publish into its own stage after pushing the git tag#27611

Open
jshigetomi wants to merge 2 commits into
PowerShell:masterfrom
jshigetomi:separateNuGetGitHubStages
Open

Separate NuGet publish into its own stage after pushing the git tag#27611
jshigetomi wants to merge 2 commits into
PowerShell:masterfrom
jshigetomi:separateNuGetGitHubStages

Conversation

@jshigetomi

@jshigetomi jshigetomi commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

Applies the intent of #27316 (closed due to merge
conflicts) on top of current master.

  • Extract NuGet publishing into a dedicated template release-Nuget.yml.
  • Rename release-githubNuget.yml to release-github.yml; it now only
    creates the GitHub release draft.
  • Rename stage PublishGitHubReleaseAndNuget to PublishGitHubRelease and
    point PushGitTagAndMakeDraftPublic at it.
  • Add a new PublishNugetRelease stage that runs after
    PushGitTagAndMakeDraftPublic so NuGet packages publish only after the
    git tag is pushed and the draft is made public.
  • Depend the NuGet stage directly on setReleaseTagAndChangelog so the
    OutputVersion.Version stageDependencies output variable resolves
    (Azure DevOps only exposes output variables to directly dependent
    stages); also fixed the template reference casing.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

PR Summary

This pull request refactors the release pipeline by separating the NuGet publishing process from the GitHub release process, improving clarity and maintainability. The main changes involve splitting the previously combined GitHub and NuGet release stages into distinct stages and templates, and updating the related pipeline configuration files accordingly.

Pipeline structure refactoring:

  • The combined GitHub and NuGet release stage (PublishGitHubReleaseAndNuget) is split into two separate stages: PublishGitHubRelease (for GitHub releases) and PublishNugetRelease (for NuGet publishing), each with its own template and dependencies. (.pipelines/templates/stages/PowerShell-Release-Stages.yml) [1] [2]
  • The NuGet publishing job is removed from the GitHub release template (now renamed to release-github.yml), and a new dedicated template (release-Nuget.yml) is created to handle NuGet publishing. (.pipelines/templates/release-github.yml, .pipelines/templates/release-Nuget.yml) [1] [2]

Template and job updates:

  • The new release-Nuget.yml template introduces a skipPublish parameter and defines the NuGet publishing job, including steps for preparing and pushing packages. (.pipelines/templates/release-Nuget.yml)
  • Pipeline stages and job templates are updated to use the new, separate templates for GitHub and NuGet releases, ensuring correct sequencing and clearer responsibilities. (.pipelines/templates/stages/PowerShell-Release-Stages.yml) [1] [2]

These changes make the release process more modular and easier to manage by decoupling the GitHub and NuGet publishing workflows.

PR Context

Two optimization for the release pipeline, separated GitHub and NuGet releases to separate stages. Approvals seem to propagate to other stages across the pipeline.

Removed the Windows package manual validation.

PR Checklist

Justin Chung and others added 2 commits June 17, 2026 14:30
Applies the intent of PowerShell#27316 (closed due to merge
conflicts) on top of current master.

- Extract NuGet publishing into a dedicated template release-Nuget.yml.
- Rename release-githubNuget.yml to release-github.yml; it now only
  creates the GitHub release draft.
- Rename stage PublishGitHubReleaseAndNuget to PublishGitHubRelease and
  point PushGitTagAndMakeDraftPublic at it.
- Add a new PublishNugetRelease stage that runs after
  PushGitTagAndMakeDraftPublic so NuGet packages publish only after the
  git tag is pushed and the draft is made public.
- Depend the NuGet stage directly on setReleaseTagAndChangelog so the
  OutputVersion.Version stageDependencies output variable resolves
  (Azure DevOps only exposes output variables to directly dependent
  stages); also fixed the template reference casing.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jshigetomi jshigetomi added the CL-BuildPackaging Indicates that a PR should be marked as a build or packaging change in the Change Log label Jun 17, 2026
@jshigetomi jshigetomi marked this pull request as ready for review June 17, 2026 20:32
@jshigetomi jshigetomi requested a review from a team as a code owner June 17, 2026 20:32
Copilot AI review requested due to automatic review settings June 17, 2026 20:32

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

This pull request refactors the release pipeline to publish NuGet packages in a separate stage that runs after the git tag is pushed and the GitHub draft release is made public, improving release sequencing and isolating responsibilities.

Changes:

  • Split the combined GitHub+NuGet publishing stage into separate PublishGitHubRelease and PublishNugetRelease stages, adjusting dependencies so NuGet publishing happens after tag push/draft publish.
  • Introduce a dedicated release-Nuget.yml template for NuGet publishing.
  • Remove the NuGet publish job from release-github.yml, leaving it responsible only for creating the GitHub release draft.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
.pipelines/templates/stages/PowerShell-Release-Stages.yml Splits GitHub vs NuGet publishing into separate stages and reorders dependencies to publish NuGet after tag push/draft publish.
.pipelines/templates/release-Nuget.yml Adds a dedicated NuGet publishing job template consuming the release version output.
.pipelines/templates/release-github.yml Removes NuGet publishing job so the template only creates the GitHub release draft.

variables:
- template: ./variables/release-shared.yml@self
parameters:
VERSION: $[ stageDependencies.setReleaseTagAndChangelog.SetTagAndChangelog.outputs['OutputVersion.Version'] ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Backport-7.4.x-Consider Backport-7.5.x-Consider Backport-7.6.x-Consider 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