How to publish symbol packages (snupkg) on NuGet?

0xced's Avatar

0xced

28 Nov, 2019 12:23 AM

I'm trying to publish my symbol packages (.snupkg) on NuGet but only the regular packages (.nupkg) are published.

Here's my configuration:

version: '#{build}'
image: Ubuntu
configuration: Release
nuget:
  disable_publish_on_pr: true
before_build:
- ps: dotnet restore
build:
  project: DbContextValidation.sln
  publish_nuget: true
  publish_nuget_symbols: true
  use_snupkg_format: true
  parallel: true
  verbosity: minimal
deploy:
- provider: NuGet
  api_key:
    secure: […]

The snupkg files are correctly produced: https://ci.appveyor.com/project/0xced/dbcontextvalidation/builds/29...

Successfully created package '/tmp/7r14awoe18/DbContextValidation.EF6.1.0.0-preview.0.255.nupkg'
Successfully created package '/tmp/7r14awoe18/DbContextValidation.EF6.1.0.0-preview.0.255.snupkg'
[…]
Successfully created package '/tmp/pqetj7sp0q/DbContextValidation.EFCore.1.0.0-preview.0.255.nupkg'.
Successfully created package '/tmp/pqetj7sp0q/DbContextValidation.EFCore.1.0.0-preview.0.255.snupkg'.

But only nupkg files end up in the artifacts: https://ci.appveyor.com/project/0xced/dbcontextvalidation/builds/29...

What am I missing?

  1. Support Staff 1 Posted by Feodor Fitsner on 28 Nov, 2019 12:46 AM

    Feodor Fitsner's Avatar

    Thanks for reporting that issue! It looks like it's not yet implemented for Linux/macOS builds. I've created a new issue to fix that and deploy during the next image update: https://github.com/appveyor/ci/issues/3224

    For now you should use a workaround, like calling dotnet pack explicitly with known output directory and then publishing files from output directory to artifacts. Let me know if you need an example.

  2. 2 Posted by 0xced on 28 Nov, 2019 01:03 AM

    0xced's Avatar

    Thanks for your quick reply! I added this in after_build:

    Get-ChildItem /tmp/*/DbContextValidation.*.snupkg | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name }
    
    It's working, I have now 4 artifacts instead of 2:
    Uploading artifact DbContextValidation.EF6.1.0.0-preview.0.255.snupkg (4458 bytes)...100%
    Uploading artifact DbContextValidation.EFCore.1.0.0-preview.0.255.snupkg (4632 bytes)…100%
    

    But the snupkg files are not published to NuGet: https://ci.appveyor.com/project/0xced/dbcontextvalidation#L117

    Deploying artifacts using NuGet provider
    Publishing DbContextValidation.EF6.1.0.0-preview.0.255.nupkg to https://www.nuget.org...Skipped (A package with ID 'DbContextValidation.EF6' and version '1.0.0-preview.0.255' already exists and cannot be modified.)
    Publishing DbContextValidation.EFCore.1.0.0-preview.0.255.nupkg to https://www.nuget.org...Skipped (A package with ID 'DbContextValidation.EFCore' and version '1.0.0-preview.0.255' already exists and cannot be modified.)
    No packages were pushed.
    Build completed
    
  3. Support Staff 3 Posted by Feodor Fitsner on 28 Nov, 2019 01:17 AM

    Feodor Fitsner's Avatar

    Add -Type to Push-AppVeyorArtifact command:

    Push-AppveyorArtifact $_.FullName -FileName $_.Name -Type NuGetPackage
    
  4. 4 Posted by 0xced on 29 Nov, 2019 08:58 PM

    0xced's Avatar

    It worked perfectly, thanks!

  5. 5 Posted by 0xced on 14 May, 2020 12:39 PM

    0xced's Avatar

    I see that issue #3224 is now closed but I'm still having trouble to publish the snupkg on NuGet on an Ubuntu image.

    Here are the relevant parts of my configuration:

    image: Ubuntu
    build:
      project: DockerRunner.sln
      publish_nuget: true
      publish_nuget_symbols: true
      use_snupkg_format: true
      parallel: true
      verbosity: minimal
    deploy:
      on:
        branch: deploy
    

    Publishing of the nupgk file works but publishing of the snupkg file fails with a Method Not Allowed error:

    Deploying artifacts using NuGet provider
    Publishing DockerRunner.0.9.0-alpha.0.2.nupkg to https://www.nuget.org...OK
    Publishing DockerRunner.0.9.0-alpha.0.2.snupkg to https://nuget.smbsrc.net...
    Error publishing package. NuGet server returned 405: Method Not Allowed
    
  6. Support Staff 6 Posted by Feodor Fitsner on 14 May, 2020 05:09 PM

    Feodor Fitsner's Avatar

    Thanks for reporting that! Sounds like a bug. Will be fixed this week, please subscribe to the issue: https://github.com/appveyor/ci/issues/3431

  7. Feodor Fitsner closed this discussion on 14 Jul, 2020 09:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac