Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 2, 2026

The NuGet workflow now supports both MyGet continuous delivery and NuGet.org release publishing, retaining the original MyGet functionality while adding new NuGet release capabilities.

Changes

Workflow Structure

  • Triggers: Added dual triggers - push: branches: [master] (MyGet) and release: types: [published] (NuGet)
  • Jobs: Single unified job with conditional logic based on event type
  • Shared Steps: Common setup steps (Setup .NET, Checkout) are now defined once and shared
  • Version Determination: Centralized step that conditionally determines version, API key, and destination based on trigger event
  • Dynamic Run Names: Workflow runs display context-specific names in GitHub Actions UI
    • Push events show "Upload to MyGet" (without NuGet reference)
    • Release events show "Upload to NuGet" (without MyGet reference)

MyGet Publishing (Original Behavior Retained)

  • Trigger: Push to master branch
  • Versioning: Auto-generated 10.0.0-master-{timestamp}-{commit}
  • Secret: MYGET_KEY
  • Destination: MyGet feed

NuGet Publishing (New Functionality Added)

  • Trigger: GitHub Release published
  • Versioning: Release tag (e.g., v1.0.01.0.0)
    • Strips v prefix if present
    • Validates SemVer 2.0.0 format (X.Y.Z[-prerelease][+build])
  • Secret: NUGET_KEY
  • Destination: NuGet.org

Both workflows publish all three packages: AngouriMath, AngouriMath.FSharp, AngouriMath.Interactive.

Code Quality Improvements

  • Eliminated Duplication: Reduced workflow from 129 to 93 lines (36 lines removed)
  • Centralized Configuration: Version and target determination handled in a single step using outputs
  • Improved Maintainability: Setup and packaging logic defined once, making future updates easier
  • Security: Added explicit permissions (contents: read) following GitHub Actions best practices
  • Better UX: Dynamic run names provide clearer context for each workflow execution

Notes

  • Original MyGet workflow preserved for continuous delivery on master commits
  • New NuGet workflow added for versioned releases
  • Requires NUGET_KEY secret to be configured in repository settings for NuGet releases
Original prompt

For the nuget workflow, add a trigger on GitHub Releases publish and read the NuGet key secret instead of MyGet, then publish to NuGet with the tagged version instead of the generated version.


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

Copilot AI changed the title [WIP] Add GitHub Releases trigger for NuGet publish Switch NuGet workflow from MyGet continuous delivery to NuGet.org release publishing Jan 2, 2026
Copilot AI requested a review from Happypig375 January 2, 2026 21:16
@Happypig375
Copy link
Member

@copilot Retain the original workflow - only extend to cover NuGet releases.

@Happypig375
Copy link
Member

@copilot Some common workflow steps should be shared.

Copy link
Contributor Author

Copilot AI commented Jan 2, 2026

@copilot Retain the original workflow - only extend to cover NuGet releases.

Done. The workflow now retains the original MyGet job (triggered on push to master) and adds a new NuGet job (triggered on release publish). Both jobs run independently based on their respective triggers. Commits: 5cbf340, 8865bbd

Copilot AI changed the title Switch NuGet workflow from MyGet continuous delivery to NuGet.org release publishing Extend NuGet workflow to support both MyGet and NuGet.org publishing Jan 2, 2026
Copy link
Contributor Author

Copilot AI commented Jan 2, 2026

@copilot Some common workflow steps should be shared.

Done. Refactored the workflow to share common steps:

  • Combined two separate jobs into one with conditional logic
  • Setup .NET and checkout steps are now defined once
  • Version determination centralized in a single step using outputs
  • Reduced from 129 to 93 lines (36 lines removed)
  • Maintains both MyGet and NuGet functionality

Commit: 8279bc1

@Happypig375
Copy link
Member

@copilot Can the workflow name be displayed without "NuGet" for push, and without "MyGet" for release publish?

Copy link
Contributor Author

Copilot AI commented Jan 3, 2026

@copilot Can the workflow name be displayed without "NuGet" for push, and without "MyGet" for release publish?

Done. Added dynamic run-name that displays:

  • "Upload to MyGet" for push events (without NuGet)
  • "Upload to NuGet" for release events (without MyGet)

The workflow run name in the GitHub Actions UI will now show only the relevant target for each trigger.

Commit: 1bf1d3a

@Happypig375 Happypig375 marked this pull request as ready for review January 3, 2026 16:31
@Happypig375 Happypig375 merged commit 4fc6fda into master Jan 3, 2026
@Happypig375 Happypig375 deleted the copilot/add-nuget-workflow-trigger branch January 3, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants