{"action":"created","issue":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/508","labels_url":"https://api.github.com/repos/melonjs/melonJS/issues/508/labels{/name}","comments_url":"https://api.github.com/repos/melonjs/melonJS/issues/508/comments","events_url":"https://api.github.com/repos/melonjs/melonJS/issues/508/events","html_url":"https://github.com/melonjs/melonJS/issues/508","id":34228283,"number":508,"title":"Better release strategy (with bower)","user":{"login":"parasyte","id":456942,"avatar_url":"https://avatars.githubusercontent.com/u/456942?v=3","gravatar_id":"","url":"https://api.github.com/users/parasyte","html_url":"https://github.com/parasyte","followers_url":"https://api.github.com/users/parasyte/followers","following_url":"https://api.github.com/users/parasyte/following{/other_user}","gists_url":"https://api.github.com/users/parasyte/gists{/gist_id}","starred_url":"https://api.github.com/users/parasyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parasyte/subscriptions","organizations_url":"https://api.github.com/users/parasyte/orgs","repos_url":"https://api.github.com/users/parasyte/repos","events_url":"https://api.github.com/users/parasyte/events{/privacy}","received_events_url":"https://api.github.com/users/parasyte/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/melonjs/melonJS/labels/QA","name":"QA","color":"0b02e1"}],"state":"closed","locked":false,"assignee":{"login":"parasyte","id":456942,"avatar_url":"https://avatars.githubusercontent.com/u/456942?v=3","gravatar_id":"","url":"https://api.github.com/users/parasyte","html_url":"https://github.com/parasyte","followers_url":"https://api.github.com/users/parasyte/followers","following_url":"https://api.github.com/users/parasyte/following{/other_user}","gists_url":"https://api.github.com/users/parasyte/gists{/gist_id}","starred_url":"https://api.github.com/users/parasyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parasyte/subscriptions","organizations_url":"https://api.github.com/users/parasyte/orgs","repos_url":"https://api.github.com/users/parasyte/repos","events_url":"https://api.github.com/users/parasyte/events{/privacy}","received_events_url":"https://api.github.com/users/parasyte/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/melonjs/melonJS/milestones/20","html_url":"https://github.com/melonjs/melonJS/milestones/2.2.0","labels_url":"https://api.github.com/repos/melonjs/melonJS/milestones/20/labels","id":928007,"number":20,"title":"2.2.0","description":"","creator":{"login":"obiot","id":4033090,"avatar_url":"https://avatars.githubusercontent.com/u/4033090?v=3","gravatar_id":"","url":"https://api.github.com/users/obiot","html_url":"https://github.com/obiot","followers_url":"https://api.github.com/users/obiot/followers","following_url":"https://api.github.com/users/obiot/following{/other_user}","gists_url":"https://api.github.com/users/obiot/gists{/gist_id}","starred_url":"https://api.github.com/users/obiot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obiot/subscriptions","organizations_url":"https://api.github.com/users/obiot/orgs","repos_url":"https://api.github.com/users/obiot/repos","events_url":"https://api.github.com/users/obiot/events{/privacy}","received_events_url":"https://api.github.com/users/obiot/received_events","type":"User","site_admin":false},"open_issues":35,"closed_issues":3,"state":"open","created_at":"2015-01-09T01:45:25Z","updated_at":"2015-06-03T08:13:16Z","due_on":"2015-07-19T16:00:00Z","closed_at":null},"comments":24,"created_at":"2014-05-24T07:38:51Z","updated_at":"2015-06-03T08:13:16Z","closed_at":"2015-06-03T08:13:16Z","body":"@agmcleod @obiot I have been investigating [bower](http://bower.io/) more closely, which was discussed a bit in #227.\r\n\r\nMy understanding of the bower package manager ecosystem is still vague, at best. But it does appear to be useful for the distribution of *pre-built* melonJS releases -- something we are NOT doing with it yet.\r\n\r\nIn my experiments, I installed jQuery using `bower install jquery` in an empty directory. It creates a subdirectory called `bower_components` (synonymous to `node_modules` with `npm`) and jQuery is installed there. What's interesting to note is that in the `jquery` subdirectory, there's the full source code, plus the pre-built js files in a `dist` directory. And the bower manifest points to one of these dist files: https://github.com/jquery/jquery/blob/master/bower.json#L4\r\n\r\nBut if you look at the jQuery repo, you'll see that there is no dist directory, and in fact, it is ignored in `.gitignore`! But if you check out their latest tag, you will indeed find the dist directory: https://github.com/jquery/jquery/tree/2.1.1/dist This means the `2.1.1` tag is not in any branch. So jQuery's dist/bower register step must detach the branch, commit the dist files, tag the commit, and push the detached tag.\r\n\r\nThis is the flow I tested in a new repo, and it works really well: https://github.com/parasyte/hork The build directory is purposefully empty (just a placeholder) And I have made three tags, each with a different build file that never touched a branch, with all tags having histories from different points in the master branch. Here's how we might do this with melonJS:\r\n\r\n```\r\ngrunt\r\ngit checkout --detach\r\ngit add -f build/melonjs-1.0.1-min.js\r\ngit add -f build/melonjs-1.0.1.js\r\ngit commit -m \"Release 1.0.1\"\r\ngit tag 1.0.1\r\ngit push origin 1.0.1\r\n```\r\n\r\nWhat we're doing here is building the dist files with grunt, then detaching from the branch and committing the dist files in the detached state. This creates the commit sha1 in git history, but the commit isn't really linked anywhere. To link it with something, a tag is created (which integrates with the github release mechanism) and the tag is pushed to remote (github) to create the release.\r\n\r\nAnd of course, all of these steps can be automated to pull the version number from package.json.\r\n\r\nWith all of that done, we should be able to `bower install melonJS` and get the dist files (plus source code) installed into our project when starting a new game. No need to build melonJS, no need to install any build dependencies, and finally the `npm install` task does not need to run bower; they can live entirely independent of one another, the way it should be.\r\n\r\n----\r\n\r\nFinal note: This takes us back to our current release strategy of just using tags to keep track of releases. That much won't change. But what will need to change is how the \"Stable\" branch is initially created. I'll use \"1.1.0\" as an example for when we start to work on \"1.2.0\":\r\n\r\n1. `master` is the current \"1.1.0\" development line. We want to start working on \"1.2.0\".\r\n2. Create a new branch from `master` named `1.1.x`.\r\n    1. Create a new detached tag (see above) named `1.1.0` containing dist files.\r\n    2. Continue work in the `1.1.x` branch, with periodic detached tags for releases. \r\n    3. Never commit on top of a tag.\r\n3. Update all version numbers in `master` to \"1.2.0\".\r\n4. Continue work in the `master` branch for unstable/experimental features in the 1.2.x line."},"comment":{"url":"https://api.github.com/repos/melonjs/melonJS/issues/comments/108239882","html_url":"https://github.com/melonjs/melonJS/issues/508#issuecomment-108239882","issue_url":"https://api.github.com/repos/melonjs/melonJS/issues/508","id":108239882,"user":{"login":"parasyte","id":456942,"avatar_url":"https://avatars.githubusercontent.com/u/456942?v=3","gravatar_id":"","url":"https://api.github.com/users/parasyte","html_url":"https://github.com/parasyte","followers_url":"https://api.github.com/users/parasyte/followers","following_url":"https://api.github.com/users/parasyte/following{/other_user}","gists_url":"https://api.github.com/users/parasyte/gists{/gist_id}","starred_url":"https://api.github.com/users/parasyte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parasyte/subscriptions","organizations_url":"https://api.github.com/users/parasyte/orgs","repos_url":"https://api.github.com/users/parasyte/repos","events_url":"https://api.github.com/users/parasyte/events{/privacy}","received_events_url":"https://api.github.com/users/parasyte/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T08:13:16Z","updated_at":"2015-06-03T08:13:16Z","body":"This one is fixed. I had a lot of trouble with the last little stretch, but it's now working with rollback on failure cases!\r\n\r\nThe new release command is:\r\n\r\n```\r\n$ grunt release\r\n```\r\n\r\nRequires `npm update` to install new dependencies. The first release to use this will be v2.2.0."}}