Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build.sh: Add support for build flags #14

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Conversation

orzen
Copy link

@orzen orzen commented Dec 4, 2020

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".

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".
Export BUILD_FLAGS to an empty value if the action is called without an
explicit BUILD_FLAGS value.
Currenty, PROJECT_NAME is used referenced in `build.sh`. However, it
will always be empty since PROJECT_NAME is not exported in
`entrypoint.sh`.

This patch exports PROJECT_NAME so it becomes accessible in `build.sh`.
The name of the build output was enforced to project name. This patch
adds a configurable name for the build output dictated by BIN_NAME. The
the output will default to $PROJECT_NAME$EXT if BIN_NAME is left unset.
Note that `BUILD_FLAGS="-o $BIN_NAME"` must be used if the
`basename $CMD_PATH` != BIN_NAME.
OUTPUT can be altered through various configurations and environment
variables. This can cause OUTPUT to contain a name which is not pointing
to a file.

This patch adds a check and a warning message if OUTPUT contains a name
for a non-existing file before returning it. This should improve
debugging.
Launch shell with expected options intead of explicitly setting them in
the shell script.
Launch shell with expected options intead of explicitly setting them in
the shell script.
@azilber
Copy link

azilber commented Apr 22, 2021

I'm not sure builder and compiler flags should be going into a release action. That should be the responsibility of the specific package creator's build.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants