Asset name is always `package.nupkg` on GitHub Package Registry

Here is the line that I have in my action, where there is only one file that exists in there as  Orange.Primitives.1.1.9.nupkg

- name: Push to GitHub Packages
        run: dotnet nuget push ./artifacts/packages/*.nupkg --skip-duplicate

Here are the action logs that show it pushes the file and states the name.

Here is the result of packages that state the asset as package.nupkg.

Is this a default behavior, that I can set a flag or something so I can see the correct packages name in there?

Why I’m not able to see the correct file name under the Assets?

Side note; I already tried to push it with the exact package name instead of using **\*.nupkg**, and the result was the same.

Thanks in advance.

Hi @cilerler,

Thanks for being here! I’m happy to report that this is now fixed! You should be able to see your packages, should also be able to see their descriptions and dependencies.

Note, this applies to new uploads. I’m afraid the meta-data isn’t there for previous uploads. You would need to delete and re-upload the package if this is important.

Hi,

I tested it again, and it is still the same.

Even further, I just deleted the entire repo and recreated and pushed the content without history and still the same.

Hi this still seems to be and issue.
I’m using this action config

- name: to GitHub Feed
        run: dotnet nuget push **/*.nupkg --source https://nuget.pkg.github.com/${REPOSITORY_OWNER}/index.json --api-key ${GITHUB_TOKEN} --skip-duplicate
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          REPOSITORY_OWNER: ${{ github.repository_owner }}

and all the packages the assets are named package.nupkg

You can check all the packages here

1 Like

It seems like the assets are kept as package.nupkg by design. It is not affecting any operation, and it works as expected.

1 Like

@andreagriffiths11 sorry this doesn’t appear fixed, I’ve just uploaded some new packages and it’s still represented by package.nupkg and even when downloading it’d doesn’t prompt me to save as the correct filename.

If I download multiple packages/multiple versions (either from the same packages feed or any other one) they will download and I’ll be prompted to save them locally as package.nupkg, package1.nupkg, package2.nupkg, etc… and have absolutely no idea what software the package represents and/or which version. In it’s current state it’s quite pointless.

Hi @f2calv,

GitHub Packages keeps the name the package publishing tool used when a package was originally pushed. When using nuget.exe push or dotnet nuget push, the package.nupkg name is used.

I wrote an alternative tool for publishing NuGet packages, which you can find here:

When this pushes a package, it uses the package name and version as part of the filename.

You can see the latest version has an asset called gpr.0.1.273.nupkg here:

You can use the tool to publish your packages like this:

dotnet tool install -g gpr
gpr push <path to .nupkg> -k <PAT with read:packages and repo scope>

I hope that helps shed some light on what’s going on here!

1 Like

Thank you for the info, I’ve implemented your dotnet global tool and all is now good :slight_smile:

*However it’s not clear to me why I have to use a different tool, when pushing packages to nuget official or azure devops artifacts the package name works out correctly…

I agree this isn’t ideal, but it’s consistent across all other package ecosystems. With npm, Maven, RubyGems etc, we store artifacts using the name the package manager gives them.

BTW, it looks like here is where the NuGet tool names the artifact package.nupkg:

Ideally this would use the package name/version instead!

@jcansdale thanks for the source link I was looking for it (but in the dotnet sdk … doh)

I also found a related issue (filed way back in 2017);

1 Like