Skip to content

Push multiple package is not supprted #7146

Closed

Description

@vlesierse

It appears that NuGet currently not support pushing multiple packages by using a glob pattern. Don't know if this is a bug or intentional. dotnet nuget push *.nupkg should be removed.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Activity

  1. JRAlexander commented on Aug 21, 2018

    @JRAlexander
    Contributor

    @KathleenDollard, any thoughts?

  2. KathleenDollard commented on Aug 21, 2018

    @KathleenDollard
    Contributor

    @livarcocc @rrelyea Should this work?

  3. livarcocc commented on Aug 21, 2018

    @livarcocc

    @vlesierse what error do you get when this happens? On which operating system? And on which version of dotnet?

    Also, globbing is not something that the dotnet does by itself, it is actually supported by the underlying shell.

    I will let @rrelyea comment on whether or not multiple nupkg publishing is supported or not, independent of globbing.

  4. vlesierse commented on Aug 21, 2018

    @vlesierse
    Author

    @livarcocc It's not an error. It just pushes the first package it finds. All examples only includes one package, so it looks like it's working.

  5. jjpepper commented on Aug 28, 2018

    @jjpepper

    @vlesierse that doesn't seem right, the doco right here above states:

    "Pushes all .nupkg files in the current directory to the default push source:
    dotnet nuget push *.nupkg", so it should work.

  6. vlesierse commented on Aug 28, 2018

    @vlesierse
    Author

    @jjpepper Except it doesn't.

    ls *.nupkg
    XaasKit.AspNetCore.MultiTenancy.1.0.0-preview1-t000.nupkg
    XaasKit.AspNetCore.MultiTenancy.Abstractions.1.0.0-preview1-t000.nupkg
    dotnet nuget push *.nupkg -k <key> -s https://www.myget.org/F/xaaskit/api/v2/package
    info : Pushing XaasKit.AspNetCore.MultiTenancy.1.0.0-preview1-t000.nupkg to 'https://www.myget.org/F/xaaskit/api/v2/package'...
    info :   PUT https://www.myget.org/F/xaaskit/api/v2/package/
    info :   Created https://www.myget.org/F/xaaskit/api/v2/package/ 636ms
    info : Your package was pushed.

    Is it safe to say it it's a bug?

  7. jjpepper commented on Aug 28, 2018

    @jjpepper
  8. screig commented on Mar 5, 2019

    @screig

    I see the same issue, we have 8 packages put only one is pushed

    image

  9. kellcomnet2 commented on Mar 28, 2019

    @kellcomnet2

    same issue on linux

  10. iberodev commented on Mar 31, 2019

    @iberodev

    Any update on this?
    I've just verified that dotnet nuget is unable to push multiple packages at the same time and I can see that the documentation has not been updated yet despite being wrong.

    I've just tested it with the dotnet core 2.2 docker image: mcr.microsoft.com/dotnet/core/sdk:2.2

    the command
    dotnet nuget push */**/*.nupkg -s http://iberodev-repository/repository/mirepo/
    info : Your package was pushed.

    only pushes the first nupkg it finds.

    However the command
    dotnet nuget push **/*.nupkg -s http://iberodev-repository/repository/mirepo/
    info : Your package was pushed.

    pushes all the packages and works as expected. Notice the regular expression

  11. WhiteEagle5150 commented on Jun 23, 2019

    @WhiteEagle5150

    @iberodev,

    Your solution worked for me. Thank you.

    My environment:
    gitlab-runner 11.9.1 / linux/Ubuntu 14.04
    dotnet-sdk:2.1.302-v2.6

    dotnet nuget push $OUTPUT_DIR/**/*.nupkg ...

  12. 16 remaining items

  13. rrelyea commented on Mar 25, 2020

    @rrelyea
    Contributor
  14. heng-liu commented on Apr 2, 2020

    @heng-liu
    Contributor

    Tried on Linux for multiple versions of dotnet:
    2.1.302

    henli@henli001UbuntuRepro:~/packages$ dotnet --version
    2.1.302
    henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ *.nupkg
    info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
    info : Your package was pushed.
    henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ '*.nupkg'
    info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
    info : Your package was pushed.
    info : Pushing project2.1.0.0.nupkg to '/home/henli/source/'...
    info : Your package was pushed.
    

    2.2.300

    henli@henli001UbuntuRepro:~/packages$ dotnet --version
    2.2.300
    henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ *.nupkg
    info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
    info : Your package was pushed.
    henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ '*.nupkg'
    info : Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
    info : Your package was pushed.
    info : Pushing project2.1.0.0.nupkg to '/home/henli/source/'...
    info : Your package was pushed.
    

    3.1.201

    henli@henli001UbuntuRepro:~$ dotnet --version
    3.1.201
    henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ *.nupkg
    Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
    Your package was pushed.
    henli@henli001UbuntuRepro:~/packages$ dotnet nuget push --source ~/source/ '*.nupkg'
    Pushing project1.1.0.0.nupkg to '/home/henli/source/'...
    Your package was pushed.
    Pushing project2.1.0.0.nupkg to '/home/henli/source/'...
    Your package was pushed.
    

    Without quotes, only the first package is pushed.
    With quotes, all packages are pushed.

  15. donnie-msft commented on Apr 3, 2020

    @donnie-msft
    Contributor

    For clarity, Windows still works as expected in dotnet 3.1.300-preview-015048.

    Both push all expected packages (not just 1):
    dotnet nuget push *\**\*.nupkg --source "nugettest" --skip-duplicate
    dotnet nuget push *\*\*\*.nupkg --source "nugettest" --skip-duplicate

  16. zivkan commented on Apr 3, 2020

    @zivkan
    Member

    Heng's comment shows it best. When using '*.nupkg', it tells the shell not to expand the wildcard, so the * character is really passed to NuGet (via dotnet), and NuGet does its own globbing. Windows cmd.exe doesn't support globbing (not sure about powershell, my guess is no), which is why the single quotes are not needed around the *.nupkg. On Linux, every shell I've ever used supports globbing, so that individual apps don't need to.

    Fundamentally, the issue is that dotnet nuget push package1.nupkg package2.nupkg doesn't work. That's what dotnet/NuGet sees on Linux (or other shells), where the shell supports globbing and expands it before passing the arguments to the process.

    I think it's not Windows vs Linux, it's all about whether the shell expands globs, and NuGet appears to only support only a single argument.

  17. heng-liu commented on Apr 3, 2020

    @heng-liu
    Contributor

    Since the issue still exists, please reopen this issue. Thanks! @mairaw

  18. heng-liu commented on Apr 4, 2020

    @heng-liu
    Contributor

    After discussion, we would like to keep it closed. Sorry for the confusion caused!

  19. added a commit that references this issue on May 16, 2020
  20. added a commit that references this issue on May 20, 2020
  21. added a commit that references this issue on Dec 28, 2020
  22. added a commit that references this issue on Dec 26, 2021
  23. added a commit that references this issue on May 22, 2022
  24. added a commit that references this issue on Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions