After upgrade from v2 -> v3, nuget push ends with "File does not exist (true)" and fails the action
See original GitHub issueDescription:
With v2
, the following command succeeded:
run: dotnet nuget push .artifacts/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/MyOrg/index.json --skip-duplicaten --no-symbols true
From v3
, it fails.
Task version:
v3
Platform:
- Ubuntu
- macOS
- Windows
Runner type:
- Hosted (on Github)
- Self-hosted
Repro steps:
Have a step like the following:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
# checkout the code
- name: checkout-code
uses: actions/checkout@v3
with:
fetch-depth: 0
# setup dotnet based on global.json
- name: setup-dotnet
uses: actions/setup-dotnet@v2
- name: pack
run: make pack
# push it to nuget
- name: deploy
run: dotnet nuget push .artifacts/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} --source https://nuget.pkg.github.com/MyOrg/index.json --skip-duplicate --no-symbols true
Now, change setup-dotnet@v2
to setup-dotnet@v3
. Observe that the step will now fail after it successfully pushes all NuGet packages. The error is:
File does not exist (true)
Expected behavior:
Before and after upgrade should behave the same.
Actual behavior:
After upgrade, error is raised. Full error looks something like this:
Pushing MyComp.Extensions.Xunit.1.0.0-alpha.0.96.nupkg to 'https://nuget.pkg.github.com/MyOrg'...
PUT https://nuget.pkg.github.com/MyOrg/
OK https://nuget.pkg.github.com/MyOrg/ 1130ms
Your package was pushed.
error: File does not exist (true).
Usage: dotnet nuget push [arguments] [options]
Arguments:
[root] Specify the path to the package and your API key to push the package to the server.
More info
This seems to have been caused by this error in the NuGet client: https://github.com/NuGet/Home/issues/11601.
I don’t know if this can be fixed in the setup-dotnet
package, but clearly this was working in v2
, and now it isn’t anymore. I assume that this action has a dependency on the NuGet client, so the error may ultimately be external, but since it is caused by updating setup-dotnet
, I feel like it should be a tracked bug here as well.
Workaround
Remove --no-symbols true
from the commandline. This should be benign (if you don’t have symbols, it doesn’t do anything), but as shown, it causes the above error.
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (4 by maintainers)
Top GitHub Comments
Yes, I’m closing this issue 😉 Thank you!
Yes, as was explained in the referenced issue, in particular this comment: https://github.com/NuGet/Home/issues/11601#issuecomment-1042503383.
I wasn’t aware that
--no-symbols
without a parameter also works (the workaround I mentioned was removing that param completely). Also, I thought the error was caused by something else in the end (after all, the packages do get published).Apparently NuGet changed the cmdline parsing and now treats an argument after
--no-symbols
as a file. Thanks for diving into this, I didn’t make the connect withglobal.json
. It all makes sense now.