-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_all.sh
executable file
·32 lines (28 loc) · 1.31 KB
/
build_all.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
#!/bin/sh
set -x
version=`git describe HEAD --tags --always --abbrev=0`
revision=`git describe HEAD --tags --always`
GOPATH=$(go env GOPATH)
rm "$GOPATH/bin/hashbox/"*.zip
rm "$GOPATH/bin/hashbox/"*
BuildAndZip () {
rm "$GOPATH/bin/hashbox/$2" >/dev/null 2>&1
go build -ldflags "-X main.Version=$revision" -o "$GOPATH/bin/hashbox/$2"
rm "$GOPATH/bin/hashbox/$1-$version.zip" >/dev/null 2>&1
zip -jD "$GOPATH/bin/hashbox/$1-$version.zip" "$GOPATH/bin/hashbox/$2"
}
cd server
go fmt
GOOS=freebsd GOARCH=amd64 BuildAndZip "hashbox-freebsd-amd64" "hashbox-freebsd-amd64"
GOOS=linux GOARCH=arm GOARM=7 BuildAndZip "hashbox-linux-armv7l" "hashbox-linux-armv7l"
GOOS=darwin GOARCH=amd64 BuildAndZip "hashbox-mac-amd64" "hashbox-mac-amd64"
GOOS=darwin GOARCH=arm64 BuildAndZip "hashbox-mac-arm64" "hashbox-mac"
GOOS=windows GOARCH=amd64 BuildAndZip "hashbox-windows-amd64" "hashbox-windows.exe"
cd ../hashback
go fmt
GOOS=linux GOARCH=amd64 BuildAndZip "hashback-linux-amd64" "hashback"
GOOS=darwin GOARCH=amd64 BuildAndZip "hashback-mac-amd64" "hashback-amd64"
GOOS=darwin GOARCH=arm64 BuildAndZip "hashback-mac-arm64" "hashback"
GOOS=windows GOARCH=amd64 BuildAndZip "hashback-win-amd64" "hashback.exe"
GOOS=windows GOARCH=386 BuildAndZip "hashback-win-x86" "hashback-x86.exe"
exit 0