diff --git a/build/cross-platofrm-build.bash b/build/cross-platofrm-build.bash new file mode 100755 index 0000000..a3081fe --- /dev/null +++ b/build/cross-platofrm-build.bash @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +package=$1 +if [[ -z "$package" ]]; then + echo "usage: $0 " + exit 1 +fi +package_split=(${package//\// }) +package_name=${package_split[-1]} + +platforms=("windows/amd64" "windows/386" "darwin/amd64") + +for platform in "${platforms[@]}" +do + platform_split=(${platform//\// }) + GOOS=${platform_split[0]} + GOARCH=${platform_split[1]} + output_name=$package_name'-'$GOOS'-'$GOARCH + if [ $GOOS = "windows" ]; then + output_name+='.exe' + fi + + env GOOS=$GOOS GOARCH=$GOARCH go build -o $output_name $package + if [ $? -ne 0 ]; then + echo 'An error has occurred! Aborting the script execution...' + exit 1 + fi +done \ No newline at end of file diff --git a/build/darwin-amd64-flow b/build/darwin-amd64-flow new file mode 100755 index 0000000..99e7f23 Binary files /dev/null and b/build/darwin-amd64-flow differ diff --git a/build/linux-amd64-flow b/build/linux-amd64-flow new file mode 100755 index 0000000..e34aa4f Binary files /dev/null and b/build/linux-amd64-flow differ diff --git a/build/windows-amd64-flow.exe b/build/windows-amd64-flow.exe new file mode 100755 index 0000000..3e43226 Binary files /dev/null and b/build/windows-amd64-flow.exe differ diff --git a/flow.go b/flow.go index 30ec2d8..72838ad 100644 --- a/flow.go +++ b/flow.go @@ -16,7 +16,7 @@ func init() { func main() { APIURL := viper.GetString("APIURL") - version := "1.0" + version := "1.0" // get from build gateway := gateway.CreateGateway(models.GRPC, APIURL) rootCmd := cmd.NewCmdRoot(gateway, version)