2019-10-20 16:02:28 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-10-27 15:26:24 +01:00
|
|
|
# locate the cheat project root
|
2019-10-20 16:02:28 +02:00
|
|
|
BINDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
APPDIR=$(readlink -f "$BINDIR/..")
|
|
|
|
|
2019-11-13 00:59:37 +01:00
|
|
|
# update the vendored dependencies
|
|
|
|
go mod vendor && go mod tidy
|
|
|
|
|
2019-10-20 16:02:28 +02:00
|
|
|
# build embeds
|
|
|
|
cd "$APPDIR/cmd/cheat"
|
|
|
|
go clean && go generate
|
|
|
|
|
2019-12-28 15:53:55 +01:00
|
|
|
# amd64/darwin
|
2019-10-29 00:39:22 +01:00
|
|
|
env GOOS=darwin GOARCH=amd64 go build -mod vendor -o \
|
|
|
|
"$APPDIR/dist/cheat-darwin-amd64" "$APPDIR/cmd/cheat"
|
|
|
|
|
2019-12-28 15:53:55 +01:00
|
|
|
# amd64/linux
|
2019-10-29 00:39:22 +01:00
|
|
|
env GOOS=linux GOARCH=amd64 go build -mod vendor -o \
|
|
|
|
"$APPDIR/dist/cheat-linux-amd64" "$APPDIR/cmd/cheat"
|
|
|
|
|
2019-12-28 15:53:55 +01:00
|
|
|
# amd64/windows
|
2019-10-29 00:39:22 +01:00
|
|
|
env GOOS=windows GOARCH=amd64 go build -mod vendor -o \
|
|
|
|
"$APPDIR/dist/cheat-win-amd64.exe" "$APPDIR/cmd/cheat"
|
2019-12-28 15:53:55 +01:00
|
|
|
|
|
|
|
# arm7/linux
|
|
|
|
env GOOS=linux GOARCH=arm GOARM=7 go build -mod vendor -o \
|
|
|
|
"$APPDIR/dist/cheat-linux-arm7" "$APPDIR/cmd/cheat"
|
|
|
|
|
|
|
|
# arm6/linux
|
|
|
|
env GOOS=linux GOARCH=arm GOARM=6 go build -mod vendor -o \
|
|
|
|
"$APPDIR/dist/cheat-linux-arm6" "$APPDIR/cmd/cheat"
|
|
|
|
|
|
|
|
# arm5/linux
|
|
|
|
env GOOS=linux GOARCH=arm GOARM=5 go build -mod vendor -o \
|
|
|
|
"$APPDIR/dist/cheat-linux-arm5" "$APPDIR/cmd/cheat"
|