Skip to content

Fix workflow failure: Publish step should not fail when no .snupkg exists #121

@reneschulte

Description

@reneschulte

We successfully publish the NuGet package, but the GitHub Actions workflow still fails in the “Publish to NuGet” step because it tries to push a symbols package (*.snupkg) that is not produced.

Evidence / log excerpt:

  • "Your package was pushed."
  • then: "File does not exist (Build\nuget*.snupkg)."
  • "Error: Process completed with exit code 1."

So the publish succeeded, but the job is marked as failed due to the missing .snupkg.

Goal:
Make the publish step robust:

  • Always push Build\nuget*.nupkg (as today)
  • Only push Build\nuget*.snupkg if at least one exists
  • If no .snupkg exists, skip symbols publishing and keep the job green

Constraints:

  • Do NOT change build/pack behavior, versioning, or triggers
  • Do NOT switch packaging approach (keep current nuget pack / .nuspec flow)
  • Keep using 3rdParty\nuget\nuget.exe and the existing NUGET_API_KEY secret

Implementation notes:
Update the workflow file that contains the publish commands (e.g. .github/workflows/build-nuget.yml). Replace the publish step so it:

  1. Fails if no .nupkg exists (this should remain an error)
  2. Pushes all .nupkg files found
  3. Checks whether any .snupkg exists and only then pushes those; otherwise prints: "No .snupkg found – skipping."

Preferred approach:
Use PowerShell (shell: pwsh) with Get-ChildItem and proper error handling to avoid wildcard behavior in cmd causing non-zero exit codes.

Acceptance criteria:

  • Workflow run pushes the .nupkg successfully
  • Workflow does not fail when no .snupkg exists
  • If a .snupkg exists in Build\nuget, it is pushed as well

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions