forked from matryer/silk
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sh
executable file
·59 lines (53 loc) · 1.27 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
RELEASEDIR="build/releases"
LASTCOMMIT="$(git rev-parse HEAD)"
LASTCOMMITSHORT="$(git rev-parse --short HEAD)"
echo "Building commit: $LASTCOMMIT..."
cd "$(dirname $0)/../"
rm -rf $RELEASEDIR
mkdir -p $RELEASEDIR
VERSION="$(cat version.go | grep version | awk -F'\"' '{print $2}')"
echo "Version: $VERSION"
function build {
echo " for $1 $2..."
echo " (install dependencies)"
GOOS="$1" GOARCH="$2" go install
echo " (building)"
release="silk-$VERSION-$1-$2"
GOOS="$1" GOARCH="$2" go build -o "$RELEASEDIR/$release/silk"
echo "Version $VERSION - commit: $LASTCOMMIT" > "$RELEASEDIR/$release/README.md"
echo " (compressing)"
pushd "$RELEASEDIR"
echo "$(pwd)"
zip -r "$release.zip" "$release"
popd
echo " (cleaning up)"
rm -rf "$RELEASEDIR/$release"
echo " (done)"
}
#build darwin 386
#build darwin amd64
#build darwin arm
#build dragonfly amd64
#build freebsd 386
#build freebsd amd64
#build freebsd arm
#build linux 386
build linux amd64
#build linux arm
build linux arm64
#build linux ppc64
#build linux ppc64le
#build netbsd 386
#build netbsd amd64
#build netbsd arm
#build openbsd 386
#build openbsd amd64
#build openbsd arm
#build plan9 386
#build plan9 amd64
#build solaris amd64
#build windows 386
#build windows amd64
echo "All done."