Skip to content

Commit 221d9d8

Browse files
committed
added builds
1 parent 6181e8c commit 221d9d8

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

release.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
fi
30+
done
31+
32+

0 commit comments

Comments
 (0)