forked from benbjohnson/melomel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rakefile
72 lines (62 loc) · 2.26 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
require 'sprout'
sprout 'as3'
module Melomel
VERSION = IO.read('build.xml').match(/<property name="version" value="(.+?)"\/>/)[1]
end
#############################################################################
#
# Packaging tasks
#
#############################################################################
gem_wrap :build_melomel_gem do |t|
t.gem_name = 'sprout-melomel-library'
t.author = 'Nikita Dudnik'
t.email = '[email protected]'
t.homepage = "http://melomel.info"
t.version = Melomel::VERSION
t.package = 'target'
t.summary = "Melomel: External ActionScript Interface. Use with project Sprouts."
t.sprout_spec = "
- !ruby/object:Sprout::RemoteFileTarget
platform: universal
url: http://github.com/downloads/benbjohnson/melomel/melomel-#{Melomel::VERSION}.zip
archive_path: melomel-#{Melomel::VERSION}.swc
"
end
gem_wrap :build_melomel_stub_gem do |t|
t.gem_name = 'sprout-melomel_stub-library'
t.author = 'Nikita Dudnik'
t.email = '[email protected]'
t.homepage = "http://melomel.info"
t.version = Melomel::VERSION
t.package = 'target'
t.summary = "Stub of the the Melomel library. Use with project Sprouts."
t.sprout_spec = "
- !ruby/object:Sprout::RemoteFileTarget
platform: universal
url: http://github.com/downloads/benbjohnson/melomel/melomel-#{Melomel::VERSION}.zip
archive_path: melomel-stub-#{Melomel::VERSION}.swc
"
end
task :release do
puts ""
print "Are you sure you want to relase Melomel #{Melomel::VERSION}? [y/N] "
exit unless STDIN.gets.index(/y/i) == 0
unless `git branch` =~ /^\* master$/
puts "You must be on the master branch to release!"
exit!
end
# Build melomel gem
Rake::Task["build_melomel_gem"].invoke
sh "gem push target/sprout-melomel-library-#{Melomel::VERSION}.gem"
sh "rm target/sprout-melomel-library-#{Melomel::VERSION}.gem"
# Build melomel stub gem
Rake::Task["build_melomel_stub_gem"].invoke
sh "gem push target/sprout-melomel_stub-library-#{Melomel::VERSION}.gem"
sh "rm target/sprout-melomel_stub-library-#{Melomel::VERSION}.gem"
# Commit
sh "git commit --allow-empty -a -m 'v#{Melomel::VERSION}'"
sh "git tag v#{Melomel::VERSION}"
sh "git push origin master"
sh "git push origin v#{Melomel::VERSION}"
end