Skip to content

Fix publish workflow: use nuget pack for .nuspec files and push to GitHub Packages#503

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-publishing-to-github-feed
Draft

Fix publish workflow: use nuget pack for .nuspec files and push to GitHub Packages#503
Copilot wants to merge 3 commits intomasterfrom
copilot/fix-publishing-to-github-feed

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

The publish GitHub Actions workflow was non-functional: it used dotnet pack on standalone .nuspec files (unsupported), had broken VERSION extraction, and the push steps were commented out entirely.

Changes

  • Install NuGet CLI — Added sudo apt-get install -y nuget step; classic .nuspec packing requires the NuGet CLI, not dotnet pack
  • Replace dotnet packnuget pack — Pack each .nuspec with version override via -Version $VERSION -NonInteractive
  • Fix VERSION extraction — Replaced fragile arrTag=(${GITHUB_REF//\// }) + ${VERSION//v} (strips all v chars) with ${GITHUB_REF_NAME#v} (strips leading v only)
  • Push to GitHub Packages — Registers https://nuget.pkg.github.com/dadhi/index.json as a source authenticated via GITHUB_TOKEN, then pushes all packed .nupkg files
  • Push to NuGet.org — Pushes artifacts using NUGET_API_KEY repository secret with --skip-duplicate

Copilot AI changed the title [WIP] Fix publishing to GitHub feed including src packages Fix publish workflow: use nuget pack for .nuspec files and push to GitHub Packages Apr 12, 2026
Copilot AI requested a review from dadhi April 12, 2026 06:55
Copy link
Copy Markdown
Owner

@dadhi dadhi left a comment

Choose a reason for hiding this comment

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

What are the steps to set the secrets such as secrets.GITHUB_TOKEN on gh? Where do I get GH token? Can you add a comment to yml describing those dtrps in focused/tech words?

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 12, 2026

What are the steps to set the secrets such as secrets.GITHUB_TOKEN on gh? Where do I get GH token? Can you add a comment to yml describing those dtrps in focused/tech words?

Added inline comments to the workflow file in commit 5b97d12 explaining both secrets:

  • secrets.GITHUB_TOKEN — automatically injected by GitHub Actions for every run; zero setup required. It has packages: write permission by default for public repos, so it can push to GitHub Packages without any manual steps.

  • secrets.NUGET_API_KEY — needs one-time setup:

    1. Log in to https://www.nuget.org → account menu → API KeysCreate
    2. Set scope to Push, select the relevant package IDs (or use a glob like FastExpressionCompiler*)
    3. Copy the generated key
    4. In this GitHub repo: Settings → Secrets and variables → Actions → New repository secret
    5. Name it exactly NUGET_API_KEY and paste the key as the value

These steps are now documented directly in the YAML comments above the jobs section.

Copilot AI requested a review from dadhi April 12, 2026 09:40
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.

Fix publishing to GitHub feed including src packages

2 participants