Add trusted nuget publish - #987
Conversation
|
@dtchepak What's your opinion on auto-trigger? Shall I do that as well? Or do you prefer keeping it manual? |
oops replied on #988 (review)
|
|
Found a potential issue with this for attempt at 6.2.0 release? https://github.com/nsubstitute/NSubstitute/actions/runs/31483094369/job/93752259341 I'll try have a look at this tomorrow if you don't get a chance to in the meantime 🙇 |
|
@dtchepak Thanks for testing and sorry for the hassle. I didn't have an opportunity to test it myself. |
|
🙌 https://www.nuget.org/packages/NSubstitute/6.2.0 Thanks a lot @zvirja ! |
|
@dtchepak Thanks for the extremely quick feedback loop :) Have a lovely day! |
Closes #958
Introduce trusted NuGet publish and push to NuGet when we run
release_packages.ymlpipeline. I configured the NuGet part and also added new environment in our configuration (is needed to make sure that API key could be only retrieved for this specific pipeline). I use this approach in other places so it shall all work fine without us updating anything going forward.Packages will appear pushed under my name (not visible outside, but will appear e.g. in emails). If you have objections, you could re-configure the environment and put your own user name (you'll have to make sure to add proper record under the "Trusted Publishing" section on NuGet):
I also removed
Versionfrom csproj and instead calculate it based on the current tag value. Thereforerelease_packages.ymlshall be run on tag only. This way it's a bit easier to maintain the product.I kept triggering the pipeline manually. That's the part we could discuss. My suggestion is to add tags trigger - so if you push a tag, it's run automatically. But I leave this decision up to you @dtchepak.