ericsink / SQLitePCL.raw

A Portable Class Library (PCL) for low-level (raw) access to SQLite
Apache License 2.0
512 stars 106 forks source link

Publish to nuget from actions #434

Open ericsink opened 2 years ago

ericsink commented 2 years ago

I want the new CI/CD actions to be able to publish the resulting nuget packages.

But not every time.

I don't know much about actions yet.

Maybe a separate action that invokes the main one and then grabs the nupkgs and uploads them?

Or maybe a flag that can be passed to the main action to determine whether the publish step happens?

Worst case, we could have an entire second copy of the build action except with extra publish step at the end, but that seems silly, and I assume this is a common problem.

ericsink commented 2 years ago

Inviting help from @filipnavara once again. :-)

filipnavara commented 2 years ago

I'll be on vacation for the coming week or so but I can look into it after. We have some repositories where we instituted a policy that every change builds packages and pushes them to the GitHub Packages (not NuGet.org): https://github.com/emclient/userdialogs/blob/9082f74170adabfea212d80f1637e9eda7e0ecc1/.github/workflows/dotnet.yml#L26-L54

I am not familiar enough with GH actions and manual triggers but it should be something that is possible. I'll discuss it with my colleagues.

ericsink commented 2 years ago

https://twitter.com/chris_sainty/status/1429083614206205952?s=21

ericsink commented 2 years ago

I've made a little progress on this. There's a pub.yml action which is basically just a copy of the build action, except it's manually triggered, and it has a nuget push step added to the end.

After a few attempts, it seems to be working. A 2.0.5-pre was just pushed up to nuget.

But it seems like poor practice having two actions which are nearly the same. We probably want the build action to save the nupkgs it creates and the pub action simply pushes them instead of rebuilding them. GitHub actions appear to have an "artifacts" feature which might be what is needed here.

ericsink commented 2 years ago

The action should add a git tag for the release.