Mikael Dúi Bolinder
Mikael Dúi Bolinder

Reputation: 2287

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.

Upvotes: 10

Views: 1361

Answers (1)

Bil Simser
Bil Simser

Reputation: 1723

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.

Upvotes: 12

Related Questions