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

Disable CGO #130

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions scripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,25 @@ function build::jam(){
mkdir -p "${ARTIFACTS_DIR}"

pushd "${ROOT_DIR}" > /dev/null || return
for os in darwin linux; do
for os in darwin linux windows; do
util::print::info "Building jam on ${os}"
GOOS="${os}" GOARCH="amd64" go build -ldflags "-X github.com/paketo-buildpacks/jam/commands.jamVersion=${version}" -o "${ARTIFACTS_DIR}/jam-${os}" main.go
chmod +x "${ARTIFACTS_DIR}/jam-${os}"

local output
output="${ARTIFACTS_DIR}/jam-${os}"
if [[ "${os}" == "windows" ]]; then
output="${output}.exe"
fi

GOOS="${os}" \
GOARCH="amd64" \
CGO_ENABLED=0 \
go build \
-ldflags "-X github.com/paketo-buildpacks/jam/commands.jamVersion=${version}" \
-o "${output}" \
main.go

chmod +x "${output}"
done
util::print::info "Building jam on windows"
GOOS="windows" go build -ldflags "-X github.com/paketo-buildpacks/jam/commands.jamVersion=${version}" -o "${ARTIFACTS_DIR}/jam-windows.exe" main.go
popd > /dev/null || return
}

Expand Down