9

What's a good approach to handling software releases on github. My repo https://github.com/wheresrhys/jQuery-flickbook contains all the src and build files together with a built (minified) version of the javascript.

But I would also like it to, once I advance to the next version release, to include a e.g. jquery.flickbook-0.5.min.js file into a releases directory. To what degree can this be automated (using ant and git branches and tags), or is it something I will have to manually carry out?

wheresrhys
  • 22,558
  • 19
  • 94
  • 162

1 Answers1

14

This is how I'd do it (note: this makes the assumption that master is your "reference" branch):

  • when you are ready to release a new version, create a branch x.y-release on master and check it out (git checkout -b x.y-release master);
  • add your minified version, commit;
  • create a tag x.y (git tag x.y -- you want to have a look at the manpage, you can create "tag objects" too);
  • push the tag (not the branch) (git push theremote --tags, or even git push theremote x.y);
  • when done, switch back to master (git checkout master);
  • get rid of the release branch locally (git branch -D x.y-release) if you want to.

This means the minified version never makes its way into master but does end up in the tag, which means everything is there, as a tag is a refspec just as any branch is.

fge
  • 119,121
  • 33
  • 254
  • 329
  • since posting the question I've come across this article http://nvie.com/posts/a-successful-git-branching-model/, which loooks good, but maybe it's overkill for a simple plugin with one developer working on it. Is it a good idea to set up a develop branch, and could your versioning approach be adapted to work with it? – wheresrhys Jan 13 '12 at 13:36
  • Whether you want/need development branches is really up to you. It sure is useful if you want to test one or more features. In any case you will probably need a "reference" branch in which you'll merge your other branches, but in any case the trick I have given would work. – fge Jan 13 '12 at 13:39
  • Yay - worked perfectly. I had a hell of a time getting it to work though as GIT wouldn't let me commit my empty releases folder in the master branch, but eventually I figured out I shodul put a .gitignore file in – wheresrhys Jan 13 '12 at 16:49
  • I like this idea. Perhaps it could be used in my future for creating installer MSI files that also shouldn't need to be included in the actual VCS. ty! – AnneTheAgile Dec 16 '14 at 17:32