Skip to content

Commit dae0868

Browse files
committed
build each individual arch as well as all of them
1 parent 2a81340 commit dae0868

1 file changed

Lines changed: 18 additions & 7 deletions

File tree

Rakefile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,32 @@ task :release do
7272
require_relative 'mrblib/version'
7373

7474
# since we're in the mruby/
75-
release_dir = Dir.pwd + "/../releases"
76-
FileUtils.mkdir_p(release_dir)
75+
release_dir = "releases/v#{MRubyCLI::Version::VERSION}"
76+
release_path = Dir.pwd + "/../#{release_dir}"
77+
app_name = "mruby-cli-#{MRubyCLI::Version::VERSION}"
78+
FileUtils.mkdir_p(release_path)
7779

7880
Dir.mktmpdir do |tmp_dir|
7981
Dir.chdir(tmp_dir) do
8082
MRuby.each_target do |target|
81-
bin = "#{build_dir}/bin/#{exefile(APP_NAME)}"
83+
arch = name
84+
bin = "#{build_dir}/bin/#{exefile(APP_NAME)}"
8285
FileUtils.mkdir_p(name)
8386
FileUtils.cp(bin, name)
84-
FileUtils.mv("host", "x86_64-pc-linux-gnu") if name == "host"
87+
if name == "host"
88+
arch = "x86_64-pc-linux-gnu"
89+
FileUtils.mv("host", arch)
90+
end
91+
92+
Dir.chdir(arch) do
93+
arch_release = "#{app_name}-#{arch}"
94+
puts "Writing #{release_dir}/#{arch_release}.tgz"
95+
`tar czf #{release_path}/#{arch_release}.tgz *`
96+
end
8597
end
8698

87-
release_file = "mruby-cli-#{MRubyCLI::Version::VERSION}.tgz"
88-
puts "Writing releases/#{release_file}"
89-
`tar czf #{release_dir}/#{release_file} *`
99+
puts "Writing #{release_dir}/#{app_name}.tgz"
100+
`tar czf #{release_path}/#{app_name}.tgz *`
90101
end
91102
end
92103
end

0 commit comments

Comments
 (0)