-
-
Notifications
You must be signed in to change notification settings - Fork 361
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
63f2948
commit fdb7d87
Showing
2 changed files
with
33 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 |
---|---|---|
|
@@ -22,3 +22,4 @@ _testmain.go | |
*.exe | ||
|
||
out/ | ||
release/ |
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,32 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
echo "Creating release dir..." | ||
mkdir -p release | ||
|
||
EXECUTABLE_NAME="exercism" | ||
|
||
PLATFORMS="darwin/386 darwin/amd64 linux/386 linux/amd64 windows/386 windows/amd64" | ||
|
||
function build-architecture { | ||
GOOS=${1%/*} | ||
GOARCH=${1#*/} | ||
echo "Creating $GOOS $GOARCH binary..." | ||
|
||
GOOS=$GOOS GOARCH=$GOARCH "$(dirname $0)/build" | ||
cd out | ||
|
||
if [ $GOOS == windows ]; then | ||
mv $EXECUTABLE_NAME $EXECUTABLE_NAME.exe | ||
tar cvzf ../release/$EXECUTABLE_NAME-$GOOS-$GOARCH.tgz $EXECUTABLE_NAME.exe | ||
else | ||
tar cvzf ../release/$EXECUTABLE_NAME-$GOOS-$GOARCH.tgz $EXECUTABLE_NAME | ||
fi | ||
|
||
cd .. | ||
} | ||
|
||
for PLATFORM in $PLATFORMS; do | ||
build-architecture $PLATFORM | ||
done |