-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sh
executable file
·33 lines (28 loc) · 1.04 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
export GOPATH=$HOME/go
if [[ -z "${CMD_PATH}" ]]; then
CMD_PATH="./..."
fi
if [ "${GITHUB_ACTIONS}" == "true" ]; then
go test "${CMD_PATH}" 1> debug.out
else
go test -v "${CMD_PATH}"
fi
BINARY="CharVomit"
if go get "${CMD_PATH}" 1>> debug.out; then
if [ "${GOOS}" == "windows" ]; then
if [ "${GITHUB_ACTIONS}" == "true" ]; then
go build -v -ldflags="-X main.gitver=$(git describe --always --long --dirty)" -o ${BINARY}.exe ./cmd/CharVomit 1>> debug.out
echo "${BINARY}.exe"
else
go build -v -ldflags="-X main.gitver=$(git describe --always --long --dirty)" -o ${BINARY}.exe ./cmd/CharVomit
fi
else
if [ "${GITHUB_ACTIONS}" == "true" ]; then
go build -v -ldflags="-X main.gitver=$(git describe --always --long --dirty)" -o ${BINARY} ./cmd/CharVomit 1>> debug.out
echo "${BINARY}"
else
go build -v -ldflags="-X main.gitver=$(git describe --always --long --dirty)" -o ${BINARY} ./cmd/CharVomit
fi
fi
fi