From 6a5d26fda5a8baaef4164fc3f438ad7c9e1f829c Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Wed, 27 Mar 2024 14:29:09 +0000 Subject: [PATCH 1/2] Bump pipeline from 1.37.2 to 1.37.2 Bumps pipeline from 1.37.2 to 1.37.2. Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- .gitignore | 2 ++ scripts/build.sh | 15 +++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 592c46e..2f65ee4 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ # limitations under the License. bin/ +linux/ dependencies/ package/ scratch/ + diff --git a/scripts/build.sh b/scripts/build.sh index ffab276..dc48240 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,16 +1,19 @@ #!/usr/bin/env bash - set -euo pipefail -GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/native-image/v5/cmd/main +GOMOD=$(head -1 go.mod | awk '{print $2}') +GOOS="linux" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main" +GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o linux/arm64/bin/main "$GOMOD/cmd/main" if [ "${STRIP:-false}" != "false" ]; then - strip bin/main + strip linux/amd64/bin/main linux/arm64/bin/main fi if [ "${COMPRESS:-none}" != "none" ]; then - $COMPRESS bin/main + $COMPRESS linux/amd64/bin/main linux/arm64/bin/main fi -ln -fs main bin/build -ln -fs main bin/detect +ln -fs main linux/amd64/bin/build +ln -fs main linux/arm64/bin/build +ln -fs main linux/amd64/bin/detect +ln -fs main linux/arm64/bin/detect \ No newline at end of file From 7f6d593ccbd9c0f55387bfaac6fd8f4004fe9406 Mon Sep 17 00:00:00 2001 From: Anthony Dahanne Date: Sat, 16 Mar 2024 00:44:38 +0000 Subject: [PATCH 2/2] Add dualarch configuration --- buildpack.toml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/buildpack.toml b/buildpack.toml index bdf55fe..7a272a3 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -27,9 +27,17 @@ api = "0.7" type = "Apache-2.0" uri = "https://github.com/paketo-buildpacks/native-image/blob/main/LICENSE" +[[targets]] +os = "linux" +arch = "amd64" + +[[targets]] +os = "linux" +arch = "arm64" + [metadata] pre-package = "scripts/build.sh" - include-files = ["LICENSE", "NOTICE", "README.md", "bin/build", "bin/detect", "bin/main", "buildpack.toml"] + include-files = ["LICENSE", "NOTICE", "README.md", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/main", "linux/arm64/bin/build", "linux/arm64/bin/detect", "linux/arm64/bin/main", "buildpack.toml"] [[metadata.configurations]] name = "BP_NATIVE_IMAGE"