Skip to content

Commit

Permalink
Merge pull request #506 from dbohdan/master
Browse files Browse the repository at this point in the history
Build executables for Free/Net/OpenBSD
  • Loading branch information
candid82 authored Jul 6, 2024
2 parents 4c8821c + 8cc592a commit 3310f21
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion all-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

fail=0

for test_script in `ls *-tests.sh`
for test_script in *-tests.sh
do
if [ $test_script != "all-tests.sh" ]; then
echo >&2 "RUNNING $test_script"
Expand Down
29 changes: 22 additions & 7 deletions build-all.sh
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

0 comments on commit 3310f21

Please sign in to comment.