Skip to content

Commit 2a81340

Browse files
committed
a release task
1 parent 3b230f3 commit 2a81340

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
mruby/
2+
releases/

Rakefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,29 @@ desc "cleanup"
6464
task :clean do
6565
sh "cd #{MRUBY_ROOT} && rake deep_clean"
6666
end
67+
68+
desc "generate a release tarball"
69+
task :release do
70+
require 'tmpdir'
71+
require 'fileutils'
72+
require_relative 'mrblib/version'
73+
74+
# since we're in the mruby/
75+
release_dir = Dir.pwd + "/../releases"
76+
FileUtils.mkdir_p(release_dir)
77+
78+
Dir.mktmpdir do |tmp_dir|
79+
Dir.chdir(tmp_dir) do
80+
MRuby.each_target do |target|
81+
bin = "#{build_dir}/bin/#{exefile(APP_NAME)}"
82+
FileUtils.mkdir_p(name)
83+
FileUtils.cp(bin, name)
84+
FileUtils.mv("host", "x86_64-pc-linux-gnu") if name == "host"
85+
end
86+
87+
release_file = "mruby-cli-#{MRubyCLI::Version::VERSION}.tgz"
88+
puts "Writing releases/#{release_file}"
89+
`tar czf #{release_dir}/#{release_file} *`
90+
end
91+
end
92+
end

docker-compose.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@ clean:
1818
shell:
1919
<<: *defaults
2020
command: bash
21+
release:
22+
<<: *defaults
23+
command: rake release

0 commit comments

Comments
 (0)