Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
rake task to build zip files for release
Browse files Browse the repository at this point in the history
  • Loading branch information
matsadler committed Jun 13, 2017
1 parent f2a7f3d commit 18a98eb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
require "rake/clean"
CLEAN.include("gem")
CLOBBER.include("target", "avvoenv.1")
CLEAN.include("gem", "avvoenv")
CLOBBER.include("target", "avvoenv.1", "avvoenv-mac.zip", "avvoenv-linux.tar.gz")

task default: [:"build:default", :man]
namespace :build do
Expand All @@ -9,6 +9,17 @@ namespace :build do
end
task man: "avvoenv.1"

# assumes you're building on a mac
task release: [:"build:default", :"build:linux", :man] do |t|
`mkdir -p avvoenv`
`cp target/release/avvoenv avvoenv`
`cp avvoenv.1 avvoenv`
`cp install.sh avvoenv`
`zip -r avvoenv-mac.zip avvoenv`
`cp target/x86_64-unknown-linux-musl/release/avvoenv avvoenv`
`tar -czf avvoenv-linux.tar.gz avvoenv`
end

task install: [:"build:default", :man] do |t|
prefix = ENV["PREFIX"] || "."
`mkdir -p #{prefix}/bin`
Expand Down
14 changes: 14 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

PREFIX=${@:-/usr/local}
DIR=$(cd $(dirname $0) && pwd)

mkdir -p "$PREFIX/bin"
cp "$DIR/avvoenv" "$PREFIX/bin"

mkdir -p "$PREFIX/share/man/man1"
cp "$DIR/avvoenv.1" "$PREFIX/share/man/man1"

if [ command -v mandb >/dev/null 2>&1 ]; then
mandb
fi

0 comments on commit 18a98eb

Please sign in to comment.