shanselman / Windows-Wifi-Manager

Windows Wifi Manager
MIT License
159 stars 42 forks source link

Adding framework to allow MyGet Build #14

Closed gep13 closed 11 years ago

gep13 commented 11 years ago

Adding the necessary scripts etc to allow compilation both locally, and via MyGet Build Services. This will allow pre release of package on a public MyGet Feed, and once tested and verified, package can be pushed to the upstream Chocolatey Repository.

Some more information on this...

I have created a new feed on http://www.myget.org/ with the name of shanselman, you can see it here:

https://www.myget.org/F/shanselman/

Assuming that you want to go ahead with this addition to the Wifi Manager, if you create a MyGet User Account, I will transfer ownership of the feed over to you.

With this feed in place, I am then using the MyGet Build Services, as documented here:

http://docs.myget.org/docs/reference/build-services

To pull the source code from my choco-myget branch, and then the MyGet Build Engine (code named Wonka) takes over, to build the entire solution, and then package the exe into the chocolatey package. In addition, assuming that the build is successful, will automatically add the nupkg file onto the MyGet Feed. As a result, you can then do:

cinst wifi-manager -pre -source https://www.myget.org/F/shanselman/

(Go ahead and try this. You should get a new Chocolatey package installed, with the latest version)

MyGet Build Services automatically takes care of updating the AssemblyInfo.cs files within the solution, based on a version number format that you specify within the configuraiton. For now, I have used 0.2,0-pre{0}, where {0} is replaced with a build counter that is maintained within MyGet.

This obviously allows testing/verification of the pre-release package. Then, when you are happy with it, you can push to an upstream package repository (in this case chocolatey), and the MyGet System will strip off the pre-release flag, and push just the published version to Chocolatey.org.

Hold on, how much is all this going to cost you? This is the best part, it won't cost you anything :-)

If you want to go ahead with this, the following steps will need to be taken:

  1. Create a MyGet Account and I will transfer ownership of it to you
  2. Accept Pull Request
  3. Update MyGet Build Definition to pull from master branch of your GitHub repo
  4. Add your Chocolatey API Key to the Upstream Package Source within MyGet
  5. Add the MyGet HTTP Post Hook Url to your GitHub account, so that any checkin's to the master branch results in a new build (this is documented here http://docs.myget.org/docs/how-to/auto-trigger-a-myget-build-using-an-http-post-hook-url)

I think that is it :-) If you have any questions before going ahead with this, just give me a shout.

It looks very much like the Wifi manager is evolving, and you may actually need to Chocolotey packages, namely wifi-manager.app (the full UI version) and wifi-manager.tool (which is just the exe), but this can be easily added to the psake script that I have added to the build.

shanselman commented 11 years ago

Thanks, although, this seems a little complex, although educational for this little tool. Why do I need a feed in the sky to test the Chocolatey tool? I just tested it locally with -source before I pushed it.

On Wed, Jun 12, 2013 at 10:22 AM, Gary Ewan Park notifications@github.comwrote:

Adding the necessary scripts etc to allow compilation both locally, and via MyGet Build Services. This will allow pre release of package on a public MyGet Feed, and once tested and verified, package can be pushed to the upstream Chocolatey Repository.

Some more information on this...

I have created a new feed on http://www.myget.org/ with the name of shanselman, you can see it here:

https://www.myget.org/F/shanselman/

Assuming that you want to go ahead with this addition to the Wifi Manager, if you create a MyGet User Account, I will transfer ownership of the feed over to you.

With this feed in place, I am then using the MyGet Build Services, as documented here:

http://docs.myget.org/docs/reference/build-services

To pull the source code from my choco-myget branch, and then the MyGet Build Engine (code named Wonka) takes over, to build the entire solution, and then package the exe into the chocolatey package. In addition, assuming that the build is successful, will automatically add the nupkg file onto the MyGet Feed. As a result, you can then do:

cinst wifi-manager -pre -source https://www.myget.org/F/shanselman/

(Go ahead and try this. You should get a new Chocolatey package installed, with the latest version)

MyGet Build Services automatically takes care of updating the AssemblyInfo.cs files within the solution, based on a version number format that you specify within the configuraiton. For now, I have used 0.2,0-pre{0}, where {0} is replaced with a build counter that is maintained within MyGet.

This obviously allows testing/verification of the pre-release package. Then, when you are happy with it, you can push to an upstream package repository (in this case chocolatey), and the MyGet System will strip off the pre-release flag, and push just the published version to Chocolatey.org.

Hold on, how much is all this going to cost you? This is the best part, it won't cost you anything :-)

If you want to go ahead with this, the following steps will need to be taken:

  1. Create a MyGet Account and I will transfer ownership of it to you
  2. Accept Pull Request
  3. Update MyGet Build Definition to pull from master branch of your GitHub repo
  4. Add your Chocolatey API Key to the Upstream Package Source within MyGet
  5. Add the MyGet HTTP Post Hook Url to your GitHub account, so that any checkin's to the master branch results in a new build (this is documented here http://docs.myget.org/docs/how-to/auto-trigger-a-myget-build-using-an-http-post-hook-url )

I think that is it :-) If you have any questions before going ahead with this, just give me a shout.

It looks very much like the Wifi manager is evolving, and you may actually need to Chocolotey packages, namely wifi-manager.app (the full UI version) and wifi-manager.tool (which is just the exe), but this can be easily added

to the psake script that I have added to the build.

You can merge this Pull Request by running

git pull https://github.com/gep13/Windows-Wifi-Manager choco-myget

Or view, comment on, or merge it at:

https://github.com/shanselman/Windows-Wifi-Manager/pull/14 Commit Summary

  • Adding framework to allow MyGet Build

File Changes

  • M .gitignorehttps://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-0(3)
  • A BuildScripts/default.ps1https://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-1(93)
  • A BuildScripts/trigger-build.ps1https://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-2(26)
  • R ChocolateyPackage/wifi-manager.nuspechttps://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-3(4)
  • M WifiProfiles/WifiProfiles.csprojhttps://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-4(3)
  • M WifiUI/WifiUI.csprojhttps://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-5(3)
  • M build.bathttps://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-6(43)
  • A lib/NuGet.exehttps://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-7(0)
  • A lib/psake/psake.ps1https://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-8(46)
  • A lib/psake/psake.psm1https://github.com/shanselman/Windows-Wifi-Manager/pull/14/files#diff-9(702)

Patch Links:

Scott Hanselman Help me? http://hnsl.mn/fightdiabetes

gep13 commented 11 years ago

The main reason would be to allow easy "beta" version of the package to be tested by other people, ruling out the possibility to any environment specific problems that result from testing just on your machine. Granted, with the tool in it's current state, this is unlikely to happen, but it the UI takes off, and package because more complex, then a deployment pipeline like this makes it very simple to roll out :-)

shanselman commented 11 years ago

I thought about this and talked to some folks, and while I REALLY appreciate the idea and the PR, this has too many dependencies. You're welcome to fork it, though.

gep13 commented 11 years ago

Not a problem at all :-)

Out of interest, which dependencies were you most concerned about?

shanselman commented 11 years ago

The PSake script is pretty scary looking.

On Mon, Jul 1, 2013 at 11:21 PM, Gary Ewan Park notifications@github.comwrote:

Not a problem at all :-)

Out of interest, which dependencies were you most concerned about?

— Reply to this email directly or view it on GitHubhttps://github.com/shanselman/Windows-Wifi-Manager/pull/14#issuecomment-20328615 .

Scott Hanselman Help me? http://hnsl.mn/fightdiabetes

gep13 commented 11 years ago

:-)

I prefer that to looking at MSBuild Script now though.