❔ Git Hub Actions Dot Net Push keeps trying to use 1.0.0.nupkg but that file should not exist
I have an established GitHub workflow I have been using for a while that builds, tests and pushes NuGet packages for a large C# library solution.
This workflow has been working for ages doing exactly what I want which is to package all the projects into NuGet packages for me, where the version of those packages is 7.0.[run number].
However I just recently added a new C# class library project to the solution, and I am getting a frustrating issue with this workflow. Now even though the new project is set up identically to all the others it keeps trying to push a myproject.1.0.0.nupkg file instead of one with the 7.0.[run number].
Whats odd is that this file should not even exist since as you saw in the workflow, I specify that the version prefix should end with the GitHub run number and start with 7.0.
[continued below]
13 Replies
I cant figure out why this new project doesn’t work like the rest and is not correctly pushed as a 7.0.[run number] version.
I can even see in the build logs of the workflow that the correct nupkg file is being created.
The project’s csproj file looks like this:
I also thought maybe the 1.0.0.nupkg file was pushed in a commit by accident but it does not exist in the git repo and is correctly part of the .gitignore anyway.
The only other new thing that I did was add an x-unit test project and the dot net test part of the workflow but that should not cause any issues I wouldn't think.
It’s been impossible to google this specific issue since everything just takes me to how to push NuGet packages which I already know how to do.
If you need the concrete details, you can view this on the actual GitHub page since this repo is public: https://github.com/AlexLexicon/Lexicom/actions/runs/6701136141/job/18208104259
GitHub
fixed maths unit test · AlexLexicon/Lexicom@de81047
Contribute to AlexLexicon/Lexicom development by creating an account on GitHub.
I have to assume that I have missed something but at this point I feel like I have looked over everything and nothing seems incorrect or different than what I had before.
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
@TeBeClone if I run a simple dotnet build locally like the following:
I do see the correct package being generated
and the release folder on my file system only contains the 'Lexicom.Maths.7.0.12345.nupkg' file and not a 'Lexicom.Maths.1.0.0.nupkg'. In your screenshot I can see that the package that was created was in the debug folder but my yml pipeline builds for release configuration and shouldnt generate any debug output I wouldn't think
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
oh sorry the nuspec was a mistake on my part, they are nupkg files not nuspec. I will edit my response accordingly
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Maybe I am confused about something, where did you take that screenshot exactly?
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
Wow, I should have thought of that. You were correct, the test was re-building the solution causing it to generate packages again, I guess. To fix it all I had to change was the dotnet test to the following:
Which makes complete sense now that I look at it.
Thanks for helping me with this!
/close
Unknown User•13mo ago
Message Not Public
Sign In & Join Server To View
I can see the value in that format but to be honest I will probably leave it as is since I prefer this setup for what I need from it.
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.