Skip to content

Commit

Permalink
add a Rake task to release the project
Browse files Browse the repository at this point in the history
  • Loading branch information
senny committed Feb 10, 2013
1 parent 190e37b commit 9a9e358
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Rakefile
@@ -0,0 +1,24 @@
desc "create a new release"
task 'release' do
current_version = run('git tag').split(/\n/).last.strip
puts "What version do you want to release? (current: #{current_version})"
version = STDIN.gets.strip
version_tag = "v%s" % version

if run('git tag').split(/\n/).include?(version_tag)
raise("This tag has already been committed to the repo.")
end

rbenv_contents = File.read('rbenv.el')
File.write('rbenv.el', rbenv_contents.gsub("Version: #{current_version}", "Version: #{version}"))

run "git commit -a -m \"prepare #{version}\""

run "git tag -a -m \"Version #{version}\" #{version_tag}"
run "git push origin"
run "git push origin --tags"
end

def run(command)
`#{command}`
end

0 comments on commit 9a9e358

Please sign in to comment.