-
Notifications
You must be signed in to change notification settings - Fork 1
/
Rakefile
55 lines (48 loc) · 1.38 KB
/
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
46
47
48
49
50
51
52
task :default => :test
require 'rake/testtask'
Rake::TestTask.new(:test) do |test|
test.libs << 'test'
test.verbose = true
end
def release(next_version)
puts "update VERSION file with #{next_version}"
f = open("VERSION", "w")
f.write(next_version)
f.close
puts "build gems-status-#{next_version}.gem"
`gem build gems-status.gemspec`
puts "update Gemfile.lock"
`bundle check`
puts "commit VERSION and Gemfile.lock"
`git add VERSION Gemfile.lock`
`git commit -m "bump version #{next_version}"`
puts "tag git with #{next_version}"
`git tag #{next_version}`
puts "git push to origin"
`git push origin HEAD --tags`
puts "push gems-status-#{next_version}.gem to rubygems"
`gem push gems-status-#{next_version}.gem`
puts "Done!"
end
desc "release next version"
task :release do
f = open("VERSION", "r")
version = f.read().strip
f.close
version_split = version.scan /([0-9]+)\.([0-9]+)\.([0-9]+)/
version_split.flatten!
next_minor = eval(version_split[1]) + 1
next_version = "#{version_split[0]}.#{next_minor}.0"
release(next_version)
end
desc "release next MAJOR version"
task :release_major do
f = open("VERSION", "r")
version = f.read().strip
f.close
version_split = version.scan /([0-9]+)\.([0-9]+)\.([0-9]+)/
version_split.flatten!
next_major = eval(version_split[0]) + 1
next_version = "#{next_major}.0.0"
release(next_version)
end