Skip to content

Commit

Permalink
Updated release target in blade
Browse files Browse the repository at this point in the history
  • Loading branch information
otm committed Mar 15, 2016
1 parent 3516704 commit acbe1ed
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Bladefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ function target.release(version, name, description)

name = name or string.format("limes %s", version)
description = description or string.format("limes %s", version)
preRelease = ""

if not string.match(version, "^v%d[.]%d[.]%d$") then
error("fatal: version must be on the form 'vX.X.X'")
if string.match(version, "^v%d[.]%d[.]%d%-beta%d$") then
preRelease = "--pre-release"
else
error("fatal: version must be on the form 'vX.X.X'")
end
end

exitCode, output = blade._exec('git status --porcelain')
Expand All @@ -20,7 +25,7 @@ function target.release(version, name, description)
blade.sh('git tag ' .. version)
blade.sh('git push --tags')

blade.sh(string.format("github-release release --user otm --repo limes --tag %s --name '%s' --description '%s'", version, name, description))
blade.sh(string.format("github-release release --user otm --repo limes --tag %s --name '%s' --description '%s' %s", version, name, description, preRelease))

for file in io.popen("ls -1 limes_*"):lines() do
code = blade.system(string.format("github-release upload --user otm --repo limes --tag %s --name %s --file %s", version, file, file))
Expand All @@ -45,7 +50,7 @@ end

--clean working directory of builds
function target.clean()
blade.exec("rm blade blade_*")
blade.exec("rm limes limes_*")
end

--cross compile
Expand Down

0 comments on commit acbe1ed

Please sign in to comment.