-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·42 lines (30 loc) · 870 Bytes
/
build.sh
File metadata and controls
executable file
·42 lines (30 loc) · 870 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
38
39
40
41
42
#!/bin/bash
OUTPUT_BIN="jcsystool"
function release() {
VERSION="$1"
if [ -z "$VERSION" ]; then
echo "Version number is required to release"
exit 1
else
git tag -a $VERSION -m "Release version $VERSION"
LINUX_BIN="$OUTPUT_BIN-linux-amd64-$VERSION"
MAC_BIN="$OUTPUT_BIN-darwin-amd64-$VERSION"
LINUX_OUT="./build/$LINUX_BIN.tar.gz"
MAC_OUT="./build/$MAC_BIN.tar.gz"
mkdir -p ./build
env GOOS=linux GOARCH=amd64 go build -o $LINUX_BIN *.go
tar -cvf $LINUX_OUT $LINUX_BIN
rm $LINUX_BIN
env GOOS=darwin GOARCH=amd64 go build -o $MAC_BIN *.go
tar -cvf $MAC_OUT $MAC_BIN
rm $MAC_BIN
LINUX_SHA=$(shasum -a 256 $LINUX_OUT)
MAC_SHA=$(shasum -a 256 $MAC_OUT)
echo "Built Linux: $LINUX_OUT"
echo $LINUX_SHA
echo && echo
echo "Built Mac: $MAC_OUT"
echo $MAC_SHA
fi
}
release $1