more builds

This commit is contained in:
Colin 2024-05-22 23:26:51 -04:00
parent 594a6c271b
commit d71714ff11
7 changed files with 14 additions and 1 deletions

View File

@ -35,13 +35,26 @@ build_binary() {
output_name="dist/${output_name}"
echo "Building for ${os}/${arch} -> ${output_name}"
# Dynamic Linking
echo "Building dynamically linked for ${os}/${arch} -> ${output_name}"
GOOS=${os} GOARCH=${arch} go build -o ${output_name} main.go 2>build_logs/${os}_${arch}_build.log
if [ $? -eq 0 ]; then
echo "Successfully built ${output_name}"
else
echo "Failed to build ${output_name}. Check build_logs/${os}_${arch}_build.log for errors."
fi
# Static Linking
if [[ "$os" == "linux" ]]; then # Typically, static linking is most relevant for Linux environments
static_output_name="${output_name}_static"
echo "Building statically linked for ${os}/${arch} -> ${static_output_name}"
CGO_ENABLED=0 GOOS=${os} GOARCH=${arch} go build -a -ldflags '-extldflags "-static"' -o ${static_output_name} main.go 2>build_logs/${os}_${arch}_static_build.log
if [ $? -eq 0 ]; then
echo "Successfully built ${static_output_name}"
else
echo "Failed to build ${static_output_name}. Check build_logs/${os}_${arch}_static_build.log for errors."
fi
fi
}
# Main Build Process

View File

View File

View File

BIN
dist/haste-it_linux_arm64_static vendored Executable file

Binary file not shown.

BIN
dist/haste-it_linux_arm_static vendored Executable file

Binary file not shown.

BIN
dist/haste-it_static vendored Executable file

Binary file not shown.