-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #506 from dbohdan/master
Build executables for Free/Net/OpenBSD
- Loading branch information
Showing
2 changed files
with
23 additions
and
8 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
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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
#!/usr/bin/env bash | ||
set -eu | ||
|
||
version=$1 | ||
export GOARCH=amd64 | ||
export GOOS= | ||
|
||
GOOS=darwin GOARCH=amd64 go build | ||
zip joker-mac-amd64.zip joker | ||
GOOS=linux GOARCH=amd64 go build | ||
zip joker-linux-amd64.zip joker | ||
GOOS=windows GOARCH=amd64 go build | ||
zip joker-win-amd64.zip joker.exe | ||
for GOOS in darwin linux windows freebsd netbsd openbsd; do | ||
if ! go build; then | ||
echo \ | ||
error: \ | ||
"building for GOARCH=$GOARCH GOOS=$GOOS failed" \ | ||
>/dev/stderr \ | ||
; | ||
continue | ||
fi | ||
|
||
case "$GOOS" in | ||
darwin) os=mac ;; | ||
windows) os=win ;; | ||
*) os=$GOOS ;; | ||
esac | ||
[[ $GOOS = windows ]] && executable=joker.exe || executable=joker | ||
|
||
zip -9 joker-"$os"-"$GOARCH".zip "$executable" | ||
done |