-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
37 lines (32 loc) · 912 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
VER = '0.0.17'
TAGNAME = "release-#{VER}"
DIST = "idleserver-#{VER}"
desc 'Run test suite'
task :test do
system('cd client && rake test')
end
desc 'Build distribution files for new release'
#task :dist => [:tag, :test] do
task :dist do
rm_rf(DIST)
mkdir(DIST)
system("git archive master | tar -C #{DIST} -x")
File.delete("#{DIST}/Rakefile") # Don't need this file in the distribution
File.open("#{DIST}/VERSION", 'w') do |verfile|
verfile.puts(VER)
end
system("tar czf #{DIST}.tar.gz #{DIST}")
rm_rf(DIST)
system("openssl md5 #{DIST}.tar.gz > #{DIST}.tar.gz.md5")
system("openssl sha1 #{DIST}.tar.gz > #{DIST}.tar.gz.sha1")
system("gpg --detach --armor #{DIST}.tar.gz")
end
desc 'Tag a new release'
task :tag do
system("git tag -a #{TAGNAME}")
end
desc 'Clean up distribution files and work directories'
task :clean do
rm(Dir.glob('idleserver-*.tar.gz*'))
rm_rf(DIST)
end