Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to auto-publish my GitHub branch on NuGet?

I have a GitHub repo that I'd like to automatically compile and publish to NuGet when a commit is pushed.

  • How do I do it?
like image 427
Mikael Dúi Bolinder Avatar asked Mar 28 '14 08:03

Mikael Dúi Bolinder


1 Answers

I was able to work through this blog entry here http://www.xavierdecoster.com/commit-push-consume-continuous-delivery-of-resharper-extensions to get my GitHub SDK pushing up on commit.

Basically the salient points are:

  1. Setup a MyGet account (free)
  2. Create a new MyGet feed
  3. Add a Build Service that points to your GitHub repo
  4. Configure GitHub webhooks and add the MyGet Hook to GitHub (you'll find the hook on details of your new feed, it'll look something like https://../BuildSource/Hook/your-feed?identifier=SOME_GUID
  5. Add a build.bat (you can use the one on this guys post as an example) that will basically clone your GitHub repo and build it then create your package

MyGet is hosted feed for your package so you can use it for testing your packages locally. Once you've tested it (just add the MyGet feed to your Package Sources in Visual Studio) then you can push the MyGet package with a single click to NuGet.

Works great from what I've found so far. Hope that helps.

like image 83
Bil Simser Avatar answered Oct 17 '22 06:10

Bil Simser