-
-
Notifications
You must be signed in to change notification settings - Fork 410
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·37 lines (32 loc) · 811 Bytes
/
build.sh
File metadata and controls
executable file
·37 lines (32 loc) · 811 Bytes
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
#!/bin/sh -e
SYSTEMS=(windows linux freebsd darwin)
ARCHS=(amd64 386)
clean=$(git status --porcelain --untracked-files=no)
if [ -n "$clean" ]; then
echo "There are uncommited changes"
exit 1
fi
rev=$(git describe --tags --always)
if [ -e "$rev" ]; then
rm -rf "$rev"
fi
mkdir "$rev"
echo "Revision is ${rev}"
for os in ${SYSTEMS[@]}; do
for arch in ${ARCHS[@]}; do
echo "Building GOOS=$os GOARCH=$arch..."
out="staticcheck_${os}_${arch}"
if [ $os = "windows" ]; then
out="${out}.exe"
fi
CGO_ENABLED=0 GOOS=$os GOARCH=$arch go build -o "${rev}/${out}" honnef.co/go/tools/cmd/staticcheck
(
cd "$rev"
sha256sum "$out" > "$out".sha256
)
done
done
(
cd "$rev"
sha256sum -c --strict *.sha256
)