Skip to content
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
orzen:master
Open

build.sh: Add support for build flags#14
orzen wants to merge 10 commits intongs-archives:masterfrom
orzen:master

Conversation

@orzen
Copy link
Copy Markdown

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

orzen added 2 commits December 4, 2020 14:57
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`.
orzen added 6 commits December 7, 2020 09:26
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
Copy Markdown

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants