Skip to content

Commit

Permalink
Add build script
Browse files Browse the repository at this point in the history
  • Loading branch information
sj14 committed Aug 8, 2022
1 parent 495da0c commit 7d2f608
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
/dist/

main
tmp
19 changes: 19 additions & 0 deletions build.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail

mkdir -p tmp

systems=( windows linux darwin )
archs=( amd64 arm64 )

for system in "${systems[@]}"; do
for arch in "${archs[@]}"; do
if [ "$system" == "windows" ] && [ "$arch" == "arm64" ]; then
echo "windows/arm64 not yet supported by tinygo"
continue
fi
echo "building $system/$arch"
# GOOS=${system} GOARCH=${arch} tinygo build -o tmp/"${system}_${arch}" cmd/epoch/main.go
docker run --rm -w /src -v "$(pwd)":/src -e GOOS="${system}" -e GOARCH="${arch}" tinygo/tinygo tinygo build -o "tmp/${system}_${arch}" cmd/epoch/main.go
done
done

0 comments on commit 7d2f608

Please sign in to comment.