We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 6181e8c commit 221d9d8Copy full SHA for 221d9d8
release.sh
@@ -0,0 +1,32 @@
1
+#!/usr/bin/env bash
2
+package='kcc'
3
+
4
+package_split=(${package//\// })
5
+package_name=${package_split[-1]}
6
7
8
+platforms=("windows/amd64" "windows/386" "darwin/amd64")
9
+if [ -d "build/" ]; then
10
+ rm -rf build/
11
+fi
12
+mkdir build
13
+for platform in "${platforms[@]}"
14
+do
15
+ platform_split=(${platform//\// })
16
+ GOOS=${platform_split[0]}
17
+ GOARCH=${platform_split[1]}
18
19
+ output_name=$package_name'-'$GOOS'-'$GOARCH
20
21
+ if [ $GOOS = "windows" ]; then
22
+ output_name+='.exe'
23
+ fi
24
25
+ env GOOS=$GOOS GOARCH=$GOARCH go build -o build/$output_name
26
+ if [ $? -ne 0 ]; then
27
+ echo 'An error has occurred! Aborting the script execution...'
28
+ exit 1
29
30
+done
31
32
0 commit comments