Skip to content

Commit

Permalink
build.sh: Add support for build flags
Browse files Browse the repository at this point in the history
Currently, it is not possible to adjust the build process for personal
needs.

With this patch it will be possible to add compiler and linker flags as
well as adjust the name of the output if the CMD_PATH != PROJECT_NAME,
e.g. "cmd/foo/main.go".
  • Loading branch information
orzen committed Dec 4, 2020
1 parent 1820e6b commit 6cf9b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ ln -s $GITHUB_WORKSPACE $PROJECT_ROOT
cd $PROJECT_ROOT
go get -v ./...

BUILD_FLAGS=''
EXT=''

if [ $GOOS == 'windows' ]; then
Expand All @@ -19,7 +20,7 @@ fi
if [ -x "./build.sh" ]; then
OUTPUT=`./build.sh "${CMD_PATH}"`
else
go build "${CMD_PATH}"
go build ${BUILD_FLAGS} "${CMD_PATH}"
OUTPUT="${PROJECT_NAME}${EXT}"
fi

Expand Down

0 comments on commit 6cf9b42

Please sign in to comment.