Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added NuGet support #16710

Merged
merged 4 commits into from Oct 13, 2015
Merged

Added NuGet support #16710

merged 4 commits into from Oct 13, 2015

Conversation

supergibbs
Copy link
Contributor

Since it seems like there is some desire for NuGet support, I went ahead and set it up with my fork as a demo. I got both a css and less version working. Since Sass is a different repo, I can do that one next.

@mdo and team, with a simple pull request, deploy key and webhook the NuGet packaging and publishing can be fully automated. I tried to match the general settings as close as possible to the npm, bower, etc packages.

When you "release" a milestone it'll use the webhook to POST to MyGet.org to kick off the process. MyGet will pull the latest commit (not the actual release tag, didn't see that as an option) from the master branch. It runs a build script that parses the current_version out of the _config.yml Jekyll file and creates the packages. It'll then publish them to the myget feed and to the official nuget.org feed.

If anyone would like to test (and have v3.3.5!!!), you can add https://www.myget.org/F/getbootstrap/api/v2 to your NuGet sources. This is temporary, eventually it'll be on the official nuget.org feed. I set it up so, if you use the outercurve package, it'll detect it as an update. If we can't get outercurve to transfer the package id then it'll have to change to getbootstrap or something. There is also a new package called bootstrap.less that is the same structure as Twitter.Bootstrap.Less but won't be a direct upgrade since the Twitter name isn't supposed to be used. Please let me know if there are any issues or suggestions. Would anyone want a version with the individual js components instead of the full bootstrap.js?

@supergibbs supergibbs changed the title Added NuGet support 16692 Added NuGet support Issue #16692 Jun 26, 2015
@supergibbs supergibbs changed the title Added NuGet support Issue #16692 Added NuGet support Jun 26, 2015
$nuget = $env:NuGet

#parse the version number out of the Jekyll _config.yml
$yaml = (Select-String $env:SourcesPath\_config.yml -pattern "current_version").ToString().Split(" ");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json would be more canonical than the Jekyll config

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use ConvertFrom-Json here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is a bit cleaner:
$bsversion = ((Get-Content ..\package.json) -join "n" | ConvertFrom-Json).version`

@cvrebert
Copy link
Collaborator

How do the <files> sections compare to Outercurve's package?

@mdo
Copy link
Member

mdo commented Jun 26, 2015

We'll have the bootstrap project soon enough. They've responded to my message and we should have it handed over in just a couple days hopefully.

@supergibbs
Copy link
Contributor Author

@cvrebert Thanks for the feedback. I'll update in a bit once I figure a better way to parse the version. If there was a simple plain text file with the version number, would that be able to be used by other build scripts? Might be nice to have one place to update.

For the authors, package.json says Twitter, Inc but the composer.json lists Mark and Jacob. Seems from this page that the project is trying to move away from the Twitter name. Totally the teams call, just want to clarify.

As for the <files> section, it matches the outercurve section exactly except I don't include the Bootstrap logo (as Icon.png) in the root of the project. I think that was supposed to be the package icon but that convention doesn't work. I reference the apple-touch-icon.png from getbootstrap.com for the icon. Sounds like @mdo will get the NuGet account soon so users will be able to upgrade seamlessly.

Changed LESS to Less and author to Twitter, Inc.
@mdo
Copy link
Member

mdo commented Jun 29, 2015

NuGet package is officially ours: https://www.nuget.org/packages/bootstrap/.

@supergibbs
Copy link
Contributor Author

Awesome @mdo! How would you like to go about setting up the automation?

@Eonasdan
Copy link

This is a little late the game here guys. Nuget is going to stop delivering front end packages like this to all new .Net 5+ projects (MVC 6, Webforms, etc). All .Net developers are going to have to use bower to add front-end packages in the future.

See this: NuGet/Home#930

@cvrebert
Copy link
Collaborator

@supergibbs What needs to be done on our end to setup the automation? Just add a GitHub webhook? If so, where can I find the webhook URL, etc.?

@supergibbs
Copy link
Contributor Author

@cvrebert I sent it via Slack. It should be setup with just the "Release" trigger.

@cvrebert
Copy link
Collaborator

@supergibbs Added the webhook (with blank Secret). Seems like it went okay. The response to GitHub's ping event was:

HTTP 202
No commits were found matching branch 'master'. A build will not be started.

@supergibbs
Copy link
Contributor Author

Not sure about that error, looks like access sense I pointed myget.org to twbs/bootstrap. I'll see if I can figure it out. You'll need to merge in this PR for it to work regardless.

@supergibbs
Copy link
Contributor Author

@cvrebert I manually ran the myget.org build and it worked fine (no nuget since the nuspec files doesn't exist). I suspect when you tested it, it was still on my fork and there were no new commits on master.

Funny thing, it found the package.json file and built an NPM package (just locally). If interested, we can set it up so when you guys trigger a release, it'll build and publish both the NuGet and NPM packages.

@supergibbs
Copy link
Contributor Author

There are also outgoing webhooks so we can post the build statuses in Slack :)

@mdo
Copy link
Member

mdo commented Aug 5, 2015

We can skip on anything for NPM right now, but where are we on everything else? Apologies for being so sporadic here—spread a little thin :).

@supergibbs
Copy link
Contributor Author

No prob, I'm actually in Guatemala this week :)

I think we're all good, once this PR is merged and you release 3.3.6, it should build. I added @cvrebert and @mdo (check your gmail) as admins on the myget setup too. Let me know if there is anything else I can do.

cvrebert added a commit that referenced this pull request Oct 13, 2015
@cvrebert cvrebert merged commit 5b46f3d into twbs:master Oct 13, 2015
@cvrebert
Copy link
Collaborator

Thanks again! Sorry we took a while to loop back on this.

@mdo mdo mentioned this pull request Oct 13, 2015
@supergibbs supergibbs deleted the NuGet_16692 branch October 13, 2015 23:11
@supergibbs
Copy link
Contributor Author

No prob, whenever the 3.3.6 release happens we can see the the webhook/auto update setup work. Think there will be many more 3.x versions? I'll get a similar PR for 4.0 ready too. Not sure how the myget setup will work with 3.x and 4.x versions at the same time. I'll look into it.

@stgeorge
Copy link

stgeorge commented Feb 5, 2016

@Eonasdan, just because Microsoft is building a new ASP.NET Core with bower requirement, doesn't mean the millions of lines of codes in existing apps will vanish... it would be unwise to abandon nuget support since the vast majority of ASP.NET projects out there will have no plans to upgrade to Core and will continue to need nuget packages for client-side packages.

@twbs twbs locked and limited conversation to collaborators Feb 5, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants