forked from zakjan/cert-chain-resolver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircle.sh
executable file
·52 lines (39 loc) · 798 Bytes
/
circle.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
set -eu
dependencies() {
go mod download
}
build() {
go build
}
test() {
go test ./...
tests/run.sh
}
release() {
mkdir out
GOARCH="amd64"
for GOOS in linux darwin windows; do
echo "Building ${GOOS}_${GOARCH}"
DIR="${CIRCLE_PROJECT_REPONAME}_${GOOS}_${GOARCH}"
OUT="out/${DIR}/${CIRCLE_PROJECT_REPONAME}"
if [ "${GOOS}" = "windows" ]; then
OUT="${OUT}.exe"
fi
GOOS="${GOOS}" GOARCH="${GOARCH}" CGO_ENABLED=0 go build -o "${OUT}"
cd out
tar -czf "${DIR}.tar.gz" "${DIR}"
rm -rf "${DIR}"
cd ..
done
}
case "$1" in
dependencies)
dependencies;;
build)
build;;
test)
test;;
release)
release;;
esac