File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # This script is used to build Go binaries for multiple platforms.
4+ # It should be run from the root of the Strelka directory.
5+ # The resulting executables will be output to the root of the Strelka directory.
6+ #
7+ # Each permutation of GOOS (operating system), GOARCH (architecture), and executable name
8+ # is built using the Go build command.
9+ #
10+ # Before running this script, ensure that you have Go installed and that you are
11+ # in the root of the Strelka directory.
12+ # You may have to run `chmod +x misc/build-binaries/build-all-binaries.sh` to make this script executable.
13+
14+ # Define arrays for goos, goarch, and executable
15+ goos=(" linux" " windows" " darwin" " darwin" )
16+ goarch=(" amd64" " amd64" " amd64" " arm64" )
17+ executables=(" strelka-fileshot" " strelka-filestream" " strelka-oneshot" )
18+ suffixes=(" -linux" " .exe" " -mac64" " -macarm" )
19+
20+ # Iterate over each permutation and build
21+ for i in ${! goos[@]} ; do
22+ for executable in ${executables[@]} ; do
23+ GOOS=${goos[$i]} GOARCH=${goarch[$i]} go build -ldflags=" -s -w" -o ${executable}${suffixes[$i]} src/go/cmd/${executable} /main.go
24+ done
25+ done
You can’t perform that action at this time.
0 commit comments