This repository was archived by the owner on Sep 29, 2025. It is now read-only.
build.sh: Add support for build flags#14
Open
orzen wants to merge 10 commits intongs-archives:masterfrom
Open
Conversation
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.
|
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 |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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".