forked from avahowell/sia-coldstorage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·49 lines (41 loc) · 896 Bytes
/
release.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
#!/usr/bin/env bash
set -e
name="$1"
if [[ -z $name ]]; then
echo "Usage: $0 name version"
exit 1
fi
version="$2"
if [[ -z $version ]]; then
echo "Usage: $0 name version"
exit 1
fi
for os in darwin linux windows; do
folder=release/$name-$version-$os-amd64
rm -rf $folder
mkdir -p $folder
bin="$name"
if [ "$os" == "windows" ]; then
bin="${name}.exe"
fi
echo "building ${os}..."
GOOS=${os} GOARCH=amd64 go build -a -tags 'netgo' -o $folder/$bin .
cp LICENSE README.md $folder
(
cd release
zip -rq $name-$version-$os-amd64.zip $name-$version-$os-amd64
)
if [ $os = "linux" ]
then
folder=release/$name-$version-$os-arm64
rm -rf $folder
mkdir -p $folder
GOOS=${os} GOARCH=arm64 go build -a -tags 'netgo' -o $folder/$bin .
cp LICENSE README.md $folder
(
cd release
zip -rq $name-$version-$os-arm64.zip $name-$version-$os-arm64
)
fi
done
echo "done"