-
Notifications
You must be signed in to change notification settings - Fork 18
/
build.sh
executable file
·33 lines (29 loc) · 1.33 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
#!/bin/bash
function check_version {
grep "VERSION" ./akamai-purge.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=arm64 go build -o build/akamai-purge-$1-macarm64 .
shasum -a 256 build/akamai-purge-$1-macarm64 | awk '{print $1}' > build/akamai-purge-$1-macarm64.sig
GOOS=darwin GOARCH=amd64 go build -o build/akamai-purge-$1-macamd64 .
shasum -a 256 build/akamai-purge-$1-macamd64 | awk '{print $1}' > build/akamai-purge-$1-macamd64.sig
GOOS=linux GOARCH=amd64 go build -o build/akamai-purge-$1-linuxamd64 .
shasum -a 256 build/akamai-purge-$1-linuxamd64 | awk '{print $1}' > build/akamai-purge-$1-linuxamd64.sig
GOOS=linux GOARCH=386 go build -o build/akamai-purge-$1-linux386 .
shasum -a 256 build/akamai-purge-$1-linux386 | awk '{print $1}' > build/akamai-purge-$1-linux386.sig
GOOS=windows GOARCH=386 go build -o build/akamai-purge-$1-windows386.exe .
shasum -a 256 build/akamai-purge-$1-windows386.exe | awk '{print $1}' > build/akamai-purge-$1-windows386.exe.sig
GOOS=windows GOARCH=amd64 go build -o build/akamai-purge-$1-windowsamd64.exe .
shasum -a 256 build/akamai-purge-$1-windowsamd64.exe | awk '{print $1}' > build/akamai-purge-$1-windowsamd64.exe.sig