buildar 0.0.4.1 → 0.1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/rakefile.rb +36 -23
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.1.0.1
|
data/rakefile.rb
CHANGED
@@ -10,6 +10,11 @@ PROJECT_ROOT = File.dirname(__FILE__)
|
|
10
10
|
PROJECT_NAME = File.split(PROJECT_ROOT).last
|
11
11
|
VERSION_FILE = File.join(PROJECT_ROOT, 'VERSION')
|
12
12
|
MANIFEST_FILE = File.join(PROJECT_ROOT, 'MANIFEST.txt')
|
13
|
+
USE_GIT = true
|
14
|
+
GIT_COMMIT_VERSION = true # commit version bump automatically
|
15
|
+
PUBLISH = {
|
16
|
+
rubygems: true, # publish .gem to http://rubygems.org/
|
17
|
+
}
|
13
18
|
|
14
19
|
def version
|
15
20
|
File.read(VERSION_FILE).chomp
|
@@ -20,9 +25,11 @@ task :version do
|
|
20
25
|
end
|
21
26
|
|
22
27
|
task :tag => [:test] do
|
23
|
-
|
24
|
-
|
25
|
-
|
28
|
+
if USE_GIT
|
29
|
+
tagname = "v#{version}"
|
30
|
+
sh "git tag -a #{tagname} -m 'auto-tagged #{tagname} by Rake'"
|
31
|
+
sh "git push origin --tags"
|
32
|
+
end
|
26
33
|
end
|
27
34
|
|
28
35
|
def manifest
|
@@ -90,38 +97,44 @@ end
|
|
90
97
|
new_version = bump(v, old_version)
|
91
98
|
puts "bumping #{old_version} to #{new_version}"
|
92
99
|
write_version new_version
|
93
|
-
|
94
|
-
|
100
|
+
if USE_GIT and GIT_COMMIT_VERSION
|
101
|
+
sh "git add VERSION"
|
102
|
+
sh "git commit -m 'rake bump_#{v}'"
|
103
|
+
end
|
95
104
|
end
|
96
105
|
}
|
97
106
|
task :bump => [:bump_patch]
|
98
107
|
|
99
108
|
task :verify_publish_credentials do
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
109
|
+
if PUBLISH[:rubygems]
|
110
|
+
creds = '~/.gem/credentials'
|
111
|
+
fp = File.expand_path(creds)
|
112
|
+
raise "#{creds} does not exist" unless File.exists?(fp)
|
113
|
+
raise "can't read #{creds}" unless File.readable?(fp)
|
114
|
+
end
|
104
115
|
end
|
105
116
|
|
106
117
|
task :publish => [:verify_publish_credentials] do
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
118
|
+
if PUBLISH[:rubygems]
|
119
|
+
fragment = "-#{version}.gem"
|
120
|
+
pkg_dir = File.join(PROJECT_ROOT, 'pkg')
|
121
|
+
Dir.chdir(pkg_dir) {
|
122
|
+
candidates = Dir.glob "*#{fragment}"
|
123
|
+
case candidates.length
|
124
|
+
when 0
|
125
|
+
raise "could not find .gem matching #{fragment}"
|
126
|
+
when 1
|
127
|
+
sh "gem push #{candidates.first}"
|
128
|
+
else
|
129
|
+
raise "multiple candidates found matching #{fragment}"
|
130
|
+
end
|
131
|
+
}
|
132
|
+
end
|
120
133
|
end
|
121
134
|
|
122
135
|
task :gitpush do
|
123
136
|
# may prompt
|
124
|
-
sh "git push origin"
|
137
|
+
sh "git push origin" if USE_GIT
|
125
138
|
# this kills the automation
|
126
139
|
# use key-based auth?
|
127
140
|
# consider a timeout?
|