From a85846a825a41d56bd69c452f2d21cd4b2dc3a67 Mon Sep 17 00:00:00 2001 From: kim hanwoong Date: Mon, 1 Apr 2019 01:37:05 +0900 Subject: [PATCH] add cross compile script --- .gitignore | 1 + build.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .gitignore create mode 100755 build.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5e56e04 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/bin diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..400d3b6 --- /dev/null +++ b/build.sh @@ -0,0 +1,16 @@ +#!/bin/sh +APP="git-hours" +# OS별로 빌드함. +GOOS=linux GOARCH=amd64 go build -o ./bin/linux/${APP} git-hours.go +GOOS=windows GOARCH=amd64 go build -o ./bin/windows/${APP}.exe git-hours.go +GOOS=darwin GOARCH=amd64 go build -o ./bin/darwin/${APP} git-hours.go + +# Github Release에 업로드 하기위해 압축 +cd ./bin/linux/ && tar -zcvf ../${APP}_linux.tgz . && cd - +cd ./bin/windows/ && tar -zcvf ../${APP}_windows.tgz . && cd - +cd ./bin/darwin/ && tar -zcvf ../${APP}_darwin.tgz . && cd - + +# 삭제 +rm -rf ./bin/linux +rm -rf ./bin/windows +rm -rf ./bin/darwin