Updating release process.

This commit is contained in:
Bob Aman 2012-02-10 17:49:52 +03:00
parent d9f7ae0ae2
commit d021ed5503
2 changed files with 10 additions and 3 deletions

View File

@ -96,3 +96,5 @@ end
desc 'Alias to gem:package' desc 'Alias to gem:package'
task 'gem' => 'gem:package' task 'gem' => 'gem:package'
task 'gem:release' => 'gem:gemspec'

View File

@ -3,9 +3,9 @@ namespace :git do
desc 'List tags from the Git repository' desc 'List tags from the Git repository'
task :list do task :list do
tags = `git tag -l` tags = `git tag -l`
tags.gsub!('\r', '') tags.gsub!("\r", '')
tags = tags.split('\n').sort {|a, b| b <=> a } tags = tags.split("\n").sort {|a, b| b <=> a }
puts tags.join('\n') puts tags.join("\n")
end end
desc 'Create a new tag in the Git repository' desc 'Create a new tag in the Git repository'
@ -19,6 +19,11 @@ namespace :git do
v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z' v = ENV['VERSION'] or abort 'Must supply VERSION=x.y.z'
abort "Versions don't match #{v} vs #{PKG_VERSION}" if v != PKG_VERSION abort "Versions don't match #{v} vs #{PKG_VERSION}" if v != PKG_VERSION
git_status = `git status`
if git_status !~ /nothing to commit \(working directory clean\)/
abort "Working directory isn't clean."
end
tag = "#{PKG_NAME}-#{PKG_VERSION}" tag = "#{PKG_NAME}-#{PKG_VERSION}"
msg = "Release #{PKG_NAME}-#{PKG_VERSION}" msg = "Release #{PKG_NAME}-#{PKG_VERSION}"