-
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.
Add cross-compilation Github workflow
Signed-off-by: Chris Koch <[email protected]>
- Loading branch information
Showing
2 changed files
with
46 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
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,30 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
GO="go" | ||
if [ -v GOROOT ]; | ||
then | ||
GO="$GOROOT/bin/go" | ||
fi | ||
|
||
function buildem() { | ||
for GOOS in $1 | ||
do | ||
for GOARCH in $2 | ||
do | ||
echo "Building $GOOS/$GOARCH..." | ||
GOOS=$GOOS GOARCH=$GOARCH $GO build ./... | ||
done | ||
done | ||
} | ||
|
||
GOARCHES="386 amd64 arm arm64 ppc64 ppc64le s390x mips mipsle mips64 mips64le" | ||
buildem "linux" "$GOARCHES" | ||
|
||
GOARCHES="386 amd64 arm arm64" | ||
GOOSES="freebsd" # TBD netbsd openbsd windows | ||
buildem "$GOOSES" "$GOARCHES" | ||
|
||
GOARCHES_DARWIN="arm64 amd64" | ||
buildem "darwin" "$GOARCHES_DARWIN" |