NCIOCPL / NCI.OCPL.Api.Shared

Common code shared between APIs
0 stars 1 forks source link

Build for version branch fails. #49

Closed blairlearn closed 1 year ago

blairlearn commented 1 year ago

Issue description

During the build for the v2.x branch, pushing the NuGet package fails.

ESTIMATE TBD

Steps to reproduce the issue

  1. Merge new commits into a version branch (e.g. v2.x)

What's the expected result?

What's the actual result?

Additional details / screenshot

Run dotnet nuget push ./*.nupkg
  dotnet nuget push ./*.nupkg
  shell: C:\Program Files\Git\bin\bash.EXE --noprofile --norc -e -o pipefail {0}
  env:
    DOTNET_NOLOGO: true
    SHOULD_RUN: 1
    DOTNET_ROOT: C:\Program Files\dotnet
warn : No API Key was provided and no API Key could be found for 'https://nuget.pkg.github.com/NCIOCPL'. To save an API Key for a source use the 'setApiKey' command.
Pushing NCI.OCPL.Api.Common.[2](https://github.com/NCIOCPL/NCI.OCPL.Api.Shared/actions/runs/4746607208/jobs/8430931507#step:4:2).1.0.nupkg to 'https://nuget.pkg.github.com/NCIOCPL'...
  PUT https://nuget.pkg.github.com/NCIOCPL/
warn : Please use the --api-key option when publishing to GitHub Packages
  OK https://nuget.pkg.github.com/NCIOCPL/ [4](https://github.com/NCIOCPL/NCI.OCPL.Api.Shared/actions/runs/4746607208/jobs/8430931507#step:4:4)[5](https://github.com/NCIOCPL/NCI.OCPL.Api.Shared/actions/runs/4746607208/jobs/8430931507#step:4:5)9ms
Your package was pushed.
warn : No API Key was provided and no API Key could be found for 'https://nuget.pkg.github.com/NCIOCPL'. To save an API Key for a source use the 'setApiKey' command.
Pushing NCI.OCPL.Api.Common.2.1.0.symbols.nupkg to 'https://nuget.pkg.github.com/NCIOCPL'...
  PUT https://nuget.pkg.github.com/NCIOCPL/
warn : Error: Version 2.1.0 of "NCI.OCPL.Api.Common" has already been pushed.
  Conflict https://nuget.pkg.github.com/NCIOCPL/ 2[6](https://github.com/NCIOCPL/NCI.OCPL.Api.Shared/actions/runs/4746607208/jobs/8430931507#step:4:6)[7](https://github.com/NCIOCPL/NCI.OCPL.Api.Shared/actions/runs/4746607208/jobs/8430931507#step:4:7)ms
To skip already published packages, use the option --skip-duplicate
error: Response status code does not indicate success: 40[9](https://github.com/NCIOCPL/NCI.OCPL.Api.Shared/actions/runs/4746607208/jobs/8430931507#step:4:10) (Conflict).

Related Tickets

blairlearn commented 1 year ago

This appears to be related to the update of the setup-dotnet action from v1 to v3 which was done as part of #47.

In v1 of the action, the dotnet nuget push ./*.nupkg command results in only the binary code package being published. In v3, the symbols package is also published. GitHub treats this as a duplicate, causing the upload to fail.

It's not clear that GitHub can function as a symbol server (and debugging into a NuGet package is something of a dark art). For now, the best solution seems to be preventing the symbols package from being generated.

blairlearn commented 1 year ago

Fixed (or addressed anyhow) in 96b3c761712f8f64ffdf37f2ca4fdbeec30abbaa