diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 000000000..9829bcf49 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,39 @@ +# Release process + +This is fog's current release process, documented so people know what is +currently done. + +## Versioning + +fog uses semantic versioning (http://semver.org/) + +## When we release + +Releases occur monthly and are manually handled by fog's Benevolent +Dictator Wes (@geemus). + +To request a new release please raise an issue. + +## Prepare the release + +* Ensure the code is passing on the CI server [![Build Status](https://secure.travis-ci.org/fog/fog.png?branch=master)](http://travis-ci.org/fog/fog) +* Ensure the code is passing for live tests (Requires Credentials for all +services) +* Ensure working on **master** +* Update the version number (`lib/fog/version.rb`) +* Run `rake changelog` to update `changelog.txt` +* Run `rake release` to prepare the release which does: + * Prepares the release (`rake release:prepare`) + * Builds the gem + * Tags the commit + * Creates commits for version + * Publishes the release (`rake release:publish`) + * Pushes commit and tag to Github (Requires Credentials) + * Pushes gem to Rubygems (Requires Credentials) + +## Announce the release + +Once the release is prepared and uploaded it needs to be announced. + +* Send an email to https://groups.google.com/forum/?fromgroups#!forum/ruby-fog +* Tweet as @fog on Twitter (Requires Credentials) diff --git a/Rakefile b/Rakefile index cff8882d2..6990b11e2 100644 --- a/Rakefile +++ b/Rakefile @@ -95,16 +95,43 @@ end # ############################################################################# -task :release => :build do - unless `git branch` =~ /^\* master$/ - puts "You must be on the master branch to release!" - exit! +task :release => ["release:prepare", "release:publish"] + +namespace :release do + task :preflight do + unless `git branch` =~ /^\* master$/ + puts "You must be on the master branch to release!" + exit! + end + if `git tag` =~ /^\* v#{version}$/ + puts "Tag v#{version} already exists!" + exit! + end end - sh "gem install pkg/#{name}-#{version}.gem" + + task :prepare => :preflight do + Rake::Task[:build].invoke + sh "gem install pkg/#{name}-#{version}.gem" + Rake::Task[:git_mark_release].invoke + end + + task :publish do + Rake::Task[:git_push_release].invoke + Rake::Task[:gem_push].invoke + end +end + +task :git_mark_release do sh "git commit --allow-empty -a -m 'Release #{version}'" sh "git tag v#{version}" +end + +task :git_push_release do sh "git push origin master" sh "git push origin v#{version}" +end + +task :gem_push do sh "gem push pkg/#{name}-#{version}.gem" end