Skip to content

Commit

Permalink
Merge pull request #77 from paketo-buildpacks/arm64
Browse files Browse the repository at this point in the history
Add ARM64 Support
  • Loading branch information
dmikusa authored May 18, 2024
2 parents cb226e5 + 84419f7 commit 5d90c96
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 16 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pb-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ jobs:
env:
FORMAT: image
PACKAGES: test
TTL_SH_PUBLISH: "false"
VERSION: ${{ steps.version.outputs.version }}
unit:
name: Unit Test
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2022 the original author or authors.
# Copyright 2018-2020 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -13,7 +13,8 @@
# limitations under the License.

bin/
linux/
dependencies/
package/
.idea/
*.iml
scratch/

16 changes: 9 additions & 7 deletions buildpack.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2018-2022 the original author or authors.
# Copyright 2018-2024 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,7 @@ api = "0.7"
uri = "https://github.com/paketo-buildpacks/quarkus/blob/main/LICENSE"

[metadata]
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"]
pre-package = "scripts/build.sh"

[[metadata.configurations]]
Expand All @@ -39,10 +39,12 @@ api = "0.7"
name = "BP_MAVEN_POM_FILE"

[[stacks]]
id = "io.buildpacks.stacks.bionic"
id = "*"

[[stacks]]
id = "io.paketo.stacks.tiny"
[[targets]]
arch = "amd64"
os = "linux"

[[stacks]]
id = "*"
[[targets]]
arch = "arm64"
os = "linux"
15 changes: 9 additions & 6 deletions scripts/build.sh
Original file line number Diff line number Diff line change
@@ -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/quarkus/cmd/main
GOMOD=$(head -1 go.mod | awk '{print $2}')
GOOS="linux" GOARCH="amd64" 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

0 comments on commit 5d90c96

Please sign in to comment.