forked from akamai/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·32 lines (28 loc) · 1.15 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
#!/bin/bash
# Creates unsigned binaries for macOS (64bit), and Linux/Windows (32 and 64bit)
function check_version {
grep "VERSION" ./akamai.go | grep \"$1\"
if [[ $? -eq 1 ]]
then
echo "VERSION hasn't been updated"
exit 1
fi
}
if [[ -z "$1" ]]
then
echo "Version not supplied."
echo "Usage: build.sh <version>"
exit 1
fi
check_version $1
mkdir -p build
GOOS=darwin GOARCH=amd64 go build -o build/akamai-$1-macamd64 .
shasum -a 256 build/akamai-$1-macamd64 | awk '{print $1}' > build/akamai-$1-macamd64.sig
GOOS=linux GOARCH=amd64 go build -o build/akamai-$1-linuxamd64 .
shasum -a 256 build/akamai-$1-linuxamd64 | awk '{print $1}' > build/akamai-$1-linuxamd64.sig
GOOS=linux GOARCH=386 go build -o build/akamai-$1-linux386 .
shasum -a 256 build/akamai-$1-linux386 | awk '{print $1}' > build/akamai-$1-linux386.sig
GOOS=windows GOARCH=386 go build -o build/akamai-$1-windows386.exe .
shasum -a 256 build/akamai-$1-windows386.exe | awk '{print $1}' > build/akamai-$1-windows386.exe.sig
GOOS=windows GOARCH=amd64 go build -o build/akamai-$1-windowsamd64.exe .
shasum -a 256 build/akamai-$1-windowsamd64.exe | awk '{print $1}' > build/akamai-$1-windowsamd64.exe.sig