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!

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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

Recent Discussions

05 Dec, 2019 09:12 PM
04 Dec, 2019 07:46 PM
04 Dec, 2019 12:01 AM
04 Dec, 2019 12:00 AM
03 Dec, 2019 11:00 PM