Skip to content

Always push to GitHub Packages; gate NuGet.org on release only#68

Merged
ShaunWatsonCrisp merged 2 commits into
mainfrom
copilot/update-publish-workflow
Mar 4, 2026
Merged

Always push to GitHub Packages; gate NuGet.org on release only#68
ShaunWatsonCrisp merged 2 commits into
mainfrom
copilot/update-publish-workflow

Conversation

Copilot AI commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Manual workflow_dispatch runs produced no packages because the entire deploy job was gated on github.event_name == 'release'. The intent is to always publish pre-release packages to GitHub Packages, while keeping NuGet.org pushes release-only.

Changes

  • publish.yml: Removed if: github.event_name == 'release' from the deploy job level; moved it down to the NuGet.org publish step only.
deploy:
  runs-on: ubuntu-latest        # no job-level condition; always runs
  needs: [ build ]
  steps:
    - name: Publish GitHub package
      run: dotnet nuget push ...  # always pushes (pre-release on manual runs)

    - name: Publish NuGet package
      if: github.event_name == 'release'   # NuGet.org only on release
      run: dotnet nuget push ...

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: iwillspeak <1004401+iwillspeak@users.noreply.github.com>
@iwillspeak iwillspeak added enhancement New feature or request github_actions Pull requests that update GitHub Actions code labels Mar 4, 2026
@iwillspeak iwillspeak marked this pull request as ready for review March 4, 2026 10:57
Copilot AI changed the title [WIP] Update publish.yml to always push to GitHub packages feed Always push to GitHub Packages; gate NuGet.org on release only Mar 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR restructures the deploy job in the publish workflow so that the GitHub Packages feed is always updated (on every push to main, release, or manual dispatch), while publishing to NuGet.org remains gated behind a GitHub release event.

Changes:

  • Removed the if: github.event_name == 'release' condition from the deploy job level so the job always runs.
  • Added the if: github.event_name == 'release' condition specifically to the "Publish NuGet package" step (NuGet.org), keeping the "Publish GitHub package" step unconditional.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iwillspeak iwillspeak 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.

🚀

@ShaunWatsonCrisp ShaunWatsonCrisp merged commit 0115981 into main Mar 4, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants