Created
April 29, 2019 12:24
-
-
Save TwiN/8c2bfad486bdf979ee14649a1aff334c to your computer and use it in GitHub Desktop.
Multi-platform bash script to build Go binaries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APPLICATION_NAME="appname" | |
env GOOS=darwin GOARCH=amd64 go build -o bin/darwin/${APPLICATION_NAME}-darwin64 | |
env GOOS=linux GOARCH=amd64 go build -o bin/linux/${APPLICATION_NAME}-linux64 | |
env GOOS=windows GOARCH=amd64 go build -o bin/windows/${APPLICATION_NAME}-windows64.exe | |
chmod +x bin/darwin/${APPLICATION_NAME}-darwin64 | |
chmod +x bin/linux/${APPLICATION_NAME}-linux64 | |
chmod +x bin/windows/${APPLICATION_NAME}-windows64.exe |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment