brandedoutcast / publish-nuget

📦 GitHub action to automate publishing NuGet packages when project version changes
https://github.com/marketplace/actions/publish-nuget
MIT License
197 stars 101 forks source link

Nuget not finding the built file #13

Closed MarioGK closed 4 years ago

MarioGK commented 4 years ago

Hi i just tried the action, but i had an weird error:

Restore completed in 1.9 sec for /home/runner/work/EasyConfig/EasyConfig/EasyConfig/EasyConfig.csproj. /usr/share/dotnet/sdk/3.1.101/Sdks/NuGet.Build.Tasks.Pack/build/NuGet.Build.Tasks.Pack.targets(198,5): error NU5026: The file '/home/runner/work/EasyConfig/EasyConfig/EasyConfig/bin/Release/netstandard2.1/EasyConfig.dll' to be packed was not found on disk. [/home/runner/work/EasyConfig/EasyConfig/EasyConfig/EasyConfig.csproj]

It is not finding the file in the bin folder, and even though it failed to publish to Nuget the action was marked as a success, took me a while to find out it was not published/uploaded correctly.

brandedoutcast commented 4 years ago

I agree it's confusing 😕 & that's because the action wasn't expecting this behavior with dotnet pack. The fix was simple, do an explicit build & pack

The cause of this error was your project having the GeneratePackageOnBuild set to true. There's a bug in dotnet sdk with GeneratePackageOnBuild & dotnet pack combo. A fix (dotnet/sdk#3473) is targeted for 3.1.1xx