-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
37dd6b3
commit 48b0448
Showing
2 changed files
with
53 additions
and
0 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 |
---|---|---|
|
@@ -25,3 +25,5 @@ _testmain.go | |
|
||
# Application | ||
jitic | ||
release/ | ||
jitic-v* |
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,51 @@ | ||
#!/bin/sh -e | ||
|
||
# | ||
# This script is inspired by coreos/etcd. | ||
# The credits goes to coreos. | ||
# This version is only a (slightly) modified version. | ||
# | ||
# Thanks to open source and thanks to CoreOS / etcd. | ||
# | ||
# @link https://github.com/coreos/etcd/blob/master/scripts/build-release | ||
# | ||
|
||
VER=$1 | ||
PROJ="jitic" | ||
|
||
if [ -z "$1" ]; then | ||
echo "Usage: ${0} VERSION" >> /dev/stderr | ||
exit 255 | ||
fi | ||
|
||
set -u | ||
|
||
function main { | ||
mkdir release | ||
|
||
for os in darwin windows linux freebsd; do | ||
export GOOS=${os} | ||
export GOARCH="amd64" | ||
|
||
TARGET="jitic-${VER}-${GOOS}-${GOARCH}" | ||
mkdir ${TARGET} | ||
cp README.md ${TARGET}/README.md | ||
|
||
local ext="" | ||
if [ ${GOOS} == "windows" ]; then | ||
ext=".exe" | ||
fi | ||
|
||
go build -o ${TARGET}/jitic${ext} | ||
|
||
if [ ${GOOS} == "linux" ]; then | ||
tar cfz release/${TARGET}.tar.gz ${TARGET} | ||
echo "Wrote release/${TARGET}.tar.gz" | ||
else | ||
zip -qr release/${TARGET}.zip ${TARGET} | ||
echo "Wrote release/${TARGET}.zip" | ||
fi | ||
done | ||
} | ||
|
||
main |