-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the build all script using a function
- Loading branch information
1 parent
f309e10
commit ad21791
Showing
1 changed file
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,24 @@ | ||
# Builds the CLI for all operating systems | ||
GOOS=linux GOARCH=amd64 go build -ldflags "-s -w" -o bin/inkfem_linux_amd64 inkfem.go | ||
GOOS=linux GOARCH=arm64 go build -ldflags "-s -w" -o bin/inkfem_linux_arm64 inkfem.go | ||
rm -rf bin/ | ||
|
||
GOOS=darwin GOARCH=amd64 go build -ldflags "-s -w" -o bin/inkfem_darwin_amd64 inkfem.go | ||
GOOS=darwin GOARCH=arm64 go build -ldflags "-s -w" -o bin/inkfem_darwin_arm64 inkfem.go | ||
build_for_os() { | ||
echo Building for $1 OS, with $2 arch | ||
|
||
FILE_PATH=bin/inkfem_$1_$2 | ||
GOOS=$1 GOARCH=$2 go build -ldflags "-s -w" -o $FILE_PATH inkfem.go | ||
shasum -a 256 $FILE_PATH >> bin/sha256sums.txt | ||
gzip -9 $FILE_PATH | ||
} | ||
|
||
GOOS=windows GOARCH=amd64 go build -ldflags "-s -w" -o bin/inkfem_windows_amd64.exe inkfem.go | ||
# Linux | ||
build_for_os linux amd64 | ||
build_for_os linux arm64 | ||
|
||
# OSX | ||
build_for_os darwin amd64 | ||
build_for_os darwin arm64 | ||
|
||
# Windows | ||
build_for_os windows amd64 | ||
|
||
echo Done! |