-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
45 lines (36 loc) · 894 Bytes
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
require 'rubygems'
require 'bundler'
require 'rake'
def bump spec
`bundle exec tony bump #{spec}`
version = File.read('VERSION').strip
`git add VERSION`
`git commit -m "Version bump to #{version}"`
`git tag -a v#{version} -m v#{version}`
raise 'Could not add tag' unless $?.exitstatus.zero?
puts 'Version is now "%s"' % version
end
namespace :version do
namespace :bump do
desc 'Bump major component of VERSION'
task :major do
bump :major
end
desc 'Bump minor component of VERSION'
task :minor do
bump :minor
end
task :patch do
bump :patch
end
end
desc 'Bump patch component of VERSION'
task :bump => %w[ bump:patch ]
end
desc 'Tag and release a new version'
task :release do
`git push`
raise 'Push failed' unless $?.exitstatus.zero?
`git push --tag`
raise 'Tag push failed' unless $?.exitstatus.zero?
end