Skip to content

Commit e66c63d

Browse files
committed
Add build script
1 parent 495da0c commit e66c63d

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@
1515
/dist/
1616

1717
main
18+
tmp

build.bash

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
mkdir -p tmp
5+
6+
readonly systems=( windows linux darwin )
7+
readonly archs=( amd64 arm64 )
8+
9+
for system in "${systems[@]}"; do
10+
for arch in "${archs[@]}"; do
11+
if [ "$system" == "windows" ] && [ "$arch" == "arm64" ]; then
12+
echo "windows/arm64 not yet supported by tinygo"
13+
continue
14+
fi
15+
echo "building $system/$arch"
16+
# GOOS=${system} GOARCH=${arch} tinygo build -o tmp/"${system}_${arch}" cmd/epoch/main.go
17+
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
18+
done
19+
done

0 commit comments

Comments
 (0)