-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
136 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mruby/ | ||
dist/ | ||
*.tar.xz | ||
.mrb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
ifdef VERSION | ||
else | ||
VERSION := $(shell sh -c 'git describe --always --tags') | ||
endif | ||
|
||
build-all: | ||
rm -rf ./dist | ||
rm -rf ./mruby/build/macos* | ||
rm -rf ./mruby/build/linux* | ||
rake host_clean | ||
BUILD_TARGET=darwin-x86_64 rake compile | ||
rake host_clean | ||
docker-compose run --rm -e BUILD_TARGET=linux-x86_64 compile | ||
|
||
s3-deploy: | ||
aws s3 sync --acl=public-read ./dist "s3://acli/builds/$(VERSION)" | ||
|
||
downloads-md: | ||
ruby etc/generate_downloads.rb | ||
|
||
collect-bins: | ||
ruby etc/collect_bins.rb | ||
|
||
release: build-all collect-bins s3-deploy downloads-md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
require 'fileutils' | ||
|
||
Dir.chdir(File.join(__dir__, "../")) | ||
|
||
EXCLUDE_DIRS = %w(mruby/build/host mruby/build/mrbgems).freeze | ||
|
||
FileUtils.mkdir_p("dist") | ||
|
||
Dir["mruby/build/*"].each do |path| | ||
next if EXCLUDE_DIRS.include?(path) | ||
|
||
dir = File.basename(path) | ||
bin_path = File.join(path, "bin", "acli") | ||
|
||
next unless File.exist?(bin_path) | ||
|
||
FileUtils.cp(bin_path, File.join("dist", "acli-#{dir}")) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Dir.chdir(File.join(__dir__, "../")) | ||
|
||
VERSION_RXP = /^\#\# Version ([\.\-\w]+)$/ | ||
PATH_RXP = /acli\-(\w+)\-.+/ | ||
|
||
PLATFORM_NAMES = { | ||
'macos' => 'MacOS', | ||
'linux' => 'Linux', | ||
'freebsd' => 'FreeBSD', | ||
'win' => 'Windows' | ||
}.freeze | ||
|
||
contents = [] | ||
|
||
version = `git describe --always --tags`.chomp | ||
|
||
contents << "\#\# Version #{version}\n" | ||
|
||
bin_groups = Dir["dist/*"].group_by do |path| | ||
path.match(PATH_RXP)[1] | ||
end | ||
|
||
bin_groups.each do |k, files| | ||
contents << "\#\#\# #{PLATFORM_NAMES[k]}\n" | ||
|
||
files.each do |path| | ||
basepath = File.basename(path) | ||
contents << "- [#{basepath}](https://s3.amazonaws.com/acli/builds/#{version}/#{basepath})" | ||
end | ||
|
||
contents << "" | ||
end | ||
|
||
old_contents = (File.exist?("DOWNLOADS.md") ? File.read("DOWNLOADS.md") : '').split("\n") | ||
|
||
if !old_contents.empty? && (vmatch = old_contents[0].match(VERSION_RXP)) | ||
# Overwrite downloads for the same version | ||
if vmatch[1] == version | ||
old_contents = old_contents.drop(1) | ||
old_contents = old_contents.drop_while { |str| str !~ VERSION_RXP } | ||
old_contents = old_contents.drop(1) | ||
end | ||
end | ||
|
||
contents += old_contents | ||
|
||
File.write("DOWNLOADS.md", contents.join("\n")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Acli | ||
VERSION = "0.0.1" | ||
VERSION = "0.1.0" | ||
end |