From 7864f592f404e048ad20375493467380840ec91e Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Thu, 6 Jun 2024 16:53:32 -0400 Subject: [PATCH] Add ARM64 Support Signed-off-by: Daniel Mikusa --- .github/pipeline-descriptor.yml | 58 +++++++++- .github/workflows/pb-create-package.yml | 58 +++++++--- .github/workflows/pb-tests.yml | 55 ++++++--- .github/workflows/pb-update-go.yml | 4 +- .github/workflows/pb-update-jdk-17-arm-64.yml | 108 ++++++++++++++++++ .github/workflows/pb-update-jdk-17.yml | 6 +- .github/workflows/pb-update-jdk-21-arm-64.yml | 108 ++++++++++++++++++ .github/workflows/pb-update-jdk-21.yml | 6 +- .../pb-update-native-image-17-arm-64.yml | 108 ++++++++++++++++++ .../workflows/pb-update-native-image-17.yml | 6 +- .../pb-update-native-image-21-arm-64.yml | 108 ++++++++++++++++++ .../workflows/pb-update-native-image-21.yml | 6 +- .github/workflows/pb-update-pipeline.yml | 8 +- .gitignore | 2 + buildpack.toml | 84 +++++++++++++- scripts/build.sh | 20 ++-- 16 files changed, 680 insertions(+), 65 deletions(-) create mode 100644 .github/workflows/pb-update-jdk-17-arm-64.yml create mode 100644 .github/workflows/pb-update-jdk-21-arm-64.yml create mode 100644 .github/workflows/pb-update-native-image-17-arm-64.yml create mode 100644 .github/workflows/pb-update-native-image-21-arm-64.yml diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index 9acbb19..eb49440 100644 --- a/.github/pipeline-descriptor.yml +++ b/.github/pipeline-descriptor.yml @@ -2,6 +2,9 @@ github: username: ${{ secrets.JAVA_GITHUB_USERNAME }} token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} +helpers: + "bin/helper": "github.com/paketo-buildpacks/libjvm/cmd/helper" + codeowners: - path: "*" owner: "@paketo-buildpacks/java-maintainers" @@ -68,4 +71,57 @@ dependencies: tag_filter: "^jdk-(21\\.[\\d]+\\.[\\d])$" token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} version: 21 - \ No newline at end of file + +# ARM64 +- name: JDK 17 ARM64 + id: jdk + version_pattern: "17\\.[\\d]+\\.[\\d]+" + purl_pattern: "17\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: "^jdk-(17\\.[\\d]+\\.[\\d])$" + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 17 + arch: arm64 +- name: JDK 21 ARM64 + id: jdk + version_pattern: "21\\.[\\d]+\\.[\\d]+" + purl_pattern: "21\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: "^jdk-(21\\.[\\d]+\\.[\\d])$" + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 21 + arch: arm64 +- name: Native Image 17 ARM64 + id: native-image-svm + version_pattern: "17\\.[\\d]+\\.[\\d]+" + purl_pattern: "17\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: "^jdk-(17\\.[\\d]+\\.[\\d])$" + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 17 + arch: arm64 +- name: Native Image 21 ARM64 + id: native-image-svm + version_pattern: "21\\.[\\d]+\\.[\\d]+" + purl_pattern: "21\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: "^jdk-(21\\.[\\d]+\\.[\\d])$" + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 21 + arch: arm64 \ No newline at end of file diff --git a/.github/workflows/pb-create-package.yml b/.github/workflows/pb-create-package.yml index 5de71be..2ed60ba 100644 --- a/.github/workflows/pb-create-package.yml +++ b/.github/workflows/pb-create-package.yml @@ -25,7 +25,7 @@ jobs: username: ${{ secrets.PAKETO_BUILDPACKS_DOCKERHUB_USERNAME }} - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install create-package run: | #!/usr/bin/env bash @@ -33,13 +33,24 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest - - uses: buildpacks/github-actions/setup-tools@v5.5.3 + - uses: buildpacks/github-actions/setup-tools@v5.6.0 with: - crane-version: 0.19.0 + crane-version: 0.19.1 yj-version: 5.1.0 - - uses: buildpacks/github-actions/setup-pack@v5.5.3 - with: - pack-version: 0.33.2 + - name: Install pack + run: | + #!/usr/bin/env bash + # this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box + # TODO to revisit when the official one is out + set -euo pipefail + + echo "Installing pack experimental" + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack + chmod +x "${HOME}"/bin/pack - name: Enable pack Experimental if: ${{ false }} run: | @@ -106,21 +117,23 @@ jobs: if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then create-package \ - --source ${SOURCE_PATH:-.} \ + --source "${SOURCE_PATH:-.}" \ --cache-location "${HOME}"/carton-cache \ --destination "${HOME}"/buildpack \ --include-dependencies \ --version "${VERSION}" else create-package \ - --source ${SOURCE_PATH:-.} \ + --source "${SOURCE_PATH:-.}" \ --destination "${HOME}"/buildpack \ --version "${VERSION}" fi - PACKAGE_FILE=${SOURCE_PATH:-.}/package.toml - [[ -e ${PACKAGE_FILE} ]] && cp ${PACKAGE_FILE} "${HOME}"/package.toml - printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}"/buildpack "${OS}" >> "${HOME}"/package.toml + PACKAGE_FILE="${SOURCE_PATH:-.}/package.toml" + if [ -f "${PACKAGE_FILE}" ]; then + cp "${PACKAGE_FILE}" "${HOME}/buildpack/package.toml" + printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}/buildpack" "${OS}" >> "${HOME}/buildpack/package.toml" + fi env: INCLUDE_DEPENDENCIES: "false" OS: linux @@ -133,15 +146,23 @@ jobs: set -euo pipefail + COMPILED_BUILDPACK="${HOME}/buildpack" + + # create-package puts the buildpack here, we need to run from that directory + # for component buildpacks so that pack doesn't need a package.toml + cd "${COMPILED_BUILDPACK}" + CONFIG="" + if [ -f "${COMPILED_BUILDPACK}/package.toml" ]; then + CONFIG="--config ${COMPILED_BUILDPACK}/package.toml" + fi PACKAGE_LIST=($PACKAGES) # Extract first repo (Docker Hub) as the main to package & register PACKAGE=${PACKAGE_LIST[0]} if [[ "${PUBLISH:-x}" == "true" ]]; then - pack buildpack package \ - "${PACKAGE}:${VERSION}" \ - --config "${HOME}"/package.toml \ + pack -v buildpack package \ + "${PACKAGE}:${VERSION}" ${CONFIG} \ --publish if [[ -n ${VERSION_MINOR:-} && -n ${VERSION_MAJOR:-} ]]; then @@ -165,10 +186,9 @@ jobs: done else - pack buildpack package \ - "${PACKAGE}:${VERSION}" \ - --config "${HOME}"/package.toml \ - --format "${FORMAT}" + pack -v buildpack package \ + "${PACKAGE}:${VERSION}" ${CONFIG} \ + --format "${FORMAT}" $([ -n "$TTL_SH_PUBLISH" ] && [ "$TTL_SH_PUBLISH" = "true" ] && echo "--publish") fi env: PACKAGES: docker.io/paketobuildpacks/graalvm gcr.io/paketo-buildpacks/graalvm @@ -199,7 +219,7 @@ jobs: DIGEST: ${{ steps.package.outputs.digest }} GITHUB_TOKEN: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} - if: ${{ true }} - uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:4.0.1 + uses: docker://ghcr.io/buildpacks/actions/registry/request-add-entry:5.6.0 with: address: docker.io/paketobuildpacks/graalvm@${{ steps.package.outputs.digest }} id: paketo-buildpacks/graalvm diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index 6adcf4e..3f2fddb 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -17,7 +17,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install create-package run: | #!/usr/bin/env bash @@ -25,9 +25,20 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package@latest - - uses: buildpacks/github-actions/setup-pack@v5.5.3 - with: - pack-version: 0.33.2 + - name: Install pack + run: | + #!/usr/bin/env bash + # this is coming from a copy of https://github.com/buildpacks/pack/actions/runs/8118576298 stored on box + # TODO to revisit when the official one is out + set -euo pipefail + + echo "Installing pack experimental" + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl -L "https://ent.box.com/shared/static/j4d1bfe9uk1sb0i7zjvci0md9xmy41u4" -o ${HOME}/bin/pack + chmod +x "${HOME}"/bin/pack - name: Enable pack Experimental if: ${{ false }} run: | @@ -93,21 +104,23 @@ jobs: if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then create-package \ - --source ${SOURCE_PATH:-.} \ + --source "${SOURCE_PATH:-.}" \ --cache-location "${HOME}"/carton-cache \ --destination "${HOME}"/buildpack \ --include-dependencies \ --version "${VERSION}" else create-package \ - --source ${SOURCE_PATH:-.} \ + --source "${SOURCE_PATH:-.}" \ --destination "${HOME}"/buildpack \ --version "${VERSION}" fi - PACKAGE_FILE=${SOURCE_PATH:-.}/package.toml - [[ -e ${PACKAGE_FILE} ]] && cp ${PACKAGE_FILE} "${HOME}"/package.toml - printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}"/buildpack "${OS}" >> "${HOME}"/package.toml + PACKAGE_FILE="${SOURCE_PATH:-.}/package.toml" + if [ -f "${PACKAGE_FILE}" ]; then + cp "${PACKAGE_FILE}" "${HOME}/buildpack/package.toml" + printf '[buildpack]\nuri = "%s"\n\n[platform]\nos = "%s"\n' "${HOME}/buildpack" "${OS}" >> "${HOME}/buildpack/package.toml" + fi env: INCLUDE_DEPENDENCIES: "true" OS: linux @@ -118,15 +131,23 @@ jobs: set -euo pipefail + COMPILED_BUILDPACK="${HOME}/buildpack" + + # create-package puts the buildpack here, we need to run from that directory + # for component buildpacks so that pack doesn't need a package.toml + cd "${COMPILED_BUILDPACK}" + CONFIG="" + if [ -f "${COMPILED_BUILDPACK}/package.toml" ]; then + CONFIG="--config ${COMPILED_BUILDPACK}/package.toml" + fi PACKAGE_LIST=($PACKAGES) # Extract first repo (Docker Hub) as the main to package & register PACKAGE=${PACKAGE_LIST[0]} if [[ "${PUBLISH:-x}" == "true" ]]; then - pack buildpack package \ - "${PACKAGE}:${VERSION}" \ - --config "${HOME}"/package.toml \ + pack -v buildpack package \ + "${PACKAGE}:${VERSION}" ${CONFIG} \ --publish if [[ -n ${VERSION_MINOR:-} && -n ${VERSION_MAJOR:-} ]]; then @@ -150,14 +171,14 @@ jobs: done else - pack buildpack package \ - "${PACKAGE}:${VERSION}" \ - --config "${HOME}"/package.toml \ - --format "${FORMAT}" + pack -v buildpack package \ + "${PACKAGE}:${VERSION}" ${CONFIG} \ + --format "${FORMAT}" $([ -n "$TTL_SH_PUBLISH" ] && [ "$TTL_SH_PUBLISH" = "true" ] && echo "--publish") fi env: FORMAT: image PACKAGES: test + TTL_SH_PUBLISH: "false" VERSION: ${{ steps.version.outputs.version }} unit: name: Unit Test @@ -172,7 +193,7 @@ jobs: restore-keys: ${{ runner.os }}-go- - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install richgo run: | #!/usr/bin/env bash diff --git a/.github/workflows/pb-update-go.yml b/.github/workflows/pb-update-go.yml index 7d13d39..296e1a3 100644 --- a/.github/workflows/pb-update-go.yml +++ b/.github/workflows/pb-update-go.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - uses: actions/checkout@v4 - name: Update Go Version & Modules id: update-go @@ -49,7 +49,7 @@ jobs: echo "commit-body=${COMMIT_BODY}" >> "$GITHUB_OUTPUT" echo "commit-semver=${COMMIT_SEMVER}" >> "$GITHUB_OUTPUT" env: - GO_VERSION: "1.20" + GO_VERSION: "1.22" - uses: peter-evans/create-pull-request@v6 with: author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> diff --git a/.github/workflows/pb-update-jdk-17-arm-64.yml b/.github/workflows/pb-update-jdk-17-arm-64.yml new file mode 100644 index 0000000..8836b57 --- /dev/null +++ b/.github/workflows/pb-update-jdk-17-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JDK 17 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.6.0 + with: + crane-version: 0.19.1 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: ^jdk-(17\.[\d]+\.[\d])$ + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 17 + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: 17\.[\d]+\.[\d]+ + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 17\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JDK 17 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-17-arm-64 + commit-message: |- + Bump JDK 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JDK 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jdk-17.yml b/.github/workflows/pb-update-jdk-17.yml index d861289..3aaa70e 100644 --- a/.github/workflows/pb-update-jdk-17.yml +++ b/.github/workflows/pb-update-jdk-17.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install update-buildpack-dependency run: | #!/usr/bin/env bash @@ -19,9 +19,9 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest - - uses: buildpacks/github-actions/setup-tools@v5.5.3 + - uses: buildpacks/github-actions/setup-tools@v5.6.0 with: - crane-version: 0.19.0 + crane-version: 0.19.1 yj-version: 5.1.0 - uses: actions/checkout@v4 - id: dependency diff --git a/.github/workflows/pb-update-jdk-21-arm-64.yml b/.github/workflows/pb-update-jdk-21-arm-64.yml new file mode 100644 index 0000000..8ed0e2a --- /dev/null +++ b/.github/workflows/pb-update-jdk-21-arm-64.yml @@ -0,0 +1,108 @@ +name: Update JDK 21 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.6.0 + with: + crane-version: 0.19.1 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: ^jdk-(21\.[\d]+\.[\d])$ + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 21 + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: 21\.[\d]+\.[\d]+ + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 21\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `JDK 21 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-21-arm-64 + commit-message: |- + Bump JDK 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump JDK 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-jdk-21.yml b/.github/workflows/pb-update-jdk-21.yml index c325e48..8bbf825 100644 --- a/.github/workflows/pb-update-jdk-21.yml +++ b/.github/workflows/pb-update-jdk-21.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install update-buildpack-dependency run: | #!/usr/bin/env bash @@ -19,9 +19,9 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest - - uses: buildpacks/github-actions/setup-tools@v5.5.3 + - uses: buildpacks/github-actions/setup-tools@v5.6.0 with: - crane-version: 0.19.0 + crane-version: 0.19.1 yj-version: 5.1.0 - uses: actions/checkout@v4 - id: dependency diff --git a/.github/workflows/pb-update-native-image-17-arm-64.yml b/.github/workflows/pb-update-native-image-17-arm-64.yml new file mode 100644 index 0000000..a642c25 --- /dev/null +++ b/.github/workflows/pb-update-native-image-17-arm-64.yml @@ -0,0 +1,108 @@ +name: Update Native Image 17 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.6.0 + with: + crane-version: 0.19.1 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: ^jdk-(17\.[\d]+\.[\d])$ + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 17 + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: native-image-svm + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: 17\.[\d]+\.[\d]+ + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 17\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `Native Image 17 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/native-image-17-arm-64 + commit-message: |- + Bump Native Image 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps Native Image 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump Native Image 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-native-image-17.yml b/.github/workflows/pb-update-native-image-17.yml index 032585a..acd4780 100644 --- a/.github/workflows/pb-update-native-image-17.yml +++ b/.github/workflows/pb-update-native-image-17.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install update-buildpack-dependency run: | #!/usr/bin/env bash @@ -19,9 +19,9 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest - - uses: buildpacks/github-actions/setup-tools@v5.5.3 + - uses: buildpacks/github-actions/setup-tools@v5.6.0 with: - crane-version: 0.19.0 + crane-version: 0.19.1 yj-version: 5.1.0 - uses: actions/checkout@v4 - id: dependency diff --git a/.github/workflows/pb-update-native-image-21-arm-64.yml b/.github/workflows/pb-update-native-image-21-arm-64.yml new file mode 100644 index 0000000..8a5b8e0 --- /dev/null +++ b/.github/workflows/pb-update-native-image-21-arm-64.yml @@ -0,0 +1,108 @@ +name: Update Native Image 21 ARM64 +"on": + schedule: + - cron: 0 5 * * 1-5 + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/setup-go@v5 + with: + go-version: "1.22" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest + - uses: buildpacks/github-actions/setup-tools@v5.6.0 + with: + crane-version: 0.19.1 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/github-release-dependency:main + with: + arch: arm64 + glob: graalvm-community-jdk-.*_linux-x64_bin.tar.gz + owner: graalvm + repository: graalvm-ce-builds + tag_filter: ^jdk-(21\.[\d]+\.[\d])$ + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + version: 21 + - name: Update Buildpack Dependency + id: buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + VERSION_DEPS=$(yj -tj < buildpack.toml | jq -r ".metadata.dependencies[] | select( .id == env.ID ) | select( .version | test( env.VERSION_PATTERN ) )") + ARCH=${ARCH:-amd64} + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r 'select( .purl | contains( env.ARCH ) ) | .version') + + if [ -z "$OLD_VERSION" ]; then + ARCH="" # empty means noarch + OLD_VERSION=$(echo "$VERSION_DEPS" | jq -r ".version") + fi + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --arch "${ARCH}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --cpe-pattern "${CPE_PATTERN:-}" \ + --cpe "${CPE:-}" \ + --purl-pattern "${PURL_PATTERN:-}" \ + --purl "${PURL:-}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" \ + --source "${SOURCE_URI}" \ + --source-sha256 "${SOURCE_SHA256}" + + git add buildpack.toml + git checkout -- . + + if [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $1}')" != "$(echo "$VERSION" | awk -F '.' '{print $1}')" ]; then + LABEL="semver:major" + elif [ "$(echo "$OLD_VERSION" | awk -F '.' '{print $2}')" != "$(echo "$VERSION" | awk -F '.' '{print $2}')" ]; then + LABEL="semver:minor" + else + LABEL="semver:patch" + fi + + echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" + echo "new-version=${VERSION}" >> "$GITHUB_OUTPUT" + echo "version-label=${LABEL}" >> "$GITHUB_OUTPUT" + env: + ARCH: arm64 + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: native-image-svm + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: 21\.[\d]+\.[\d]+ + SHA256: ${{ steps.dependency.outputs.sha256 }} + SOURCE_SHA256: ${{ steps.dependency.outputs.source_sha256 }} + SOURCE_URI: ${{ steps.dependency.outputs.source }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: 21\.[\d]+\.[\d]+ + - uses: peter-evans/create-pull-request@v6 + with: + author: ${{ secrets.JAVA_GITHUB_USERNAME }} <${{ secrets.JAVA_GITHUB_USERNAME }}@users.noreply.github.com> + body: Bumps `Native Image 21 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/native-image-21-arm-64 + commit-message: |- + Bump Native Image 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps Native Image 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: ${{ steps.buildpack.outputs.version-label }}, type:dependency-upgrade + signoff: true + title: Bump Native Image 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/.github/workflows/pb-update-native-image-21.yml b/.github/workflows/pb-update-native-image-21.yml index 3e437e3..f3a99cc 100644 --- a/.github/workflows/pb-update-native-image-21.yml +++ b/.github/workflows/pb-update-native-image-21.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install update-buildpack-dependency run: | #!/usr/bin/env bash @@ -19,9 +19,9 @@ jobs: set -euo pipefail go install -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency@latest - - uses: buildpacks/github-actions/setup-tools@v5.5.3 + - uses: buildpacks/github-actions/setup-tools@v5.6.0 with: - crane-version: 0.19.0 + crane-version: 0.19.1 yj-version: 5.1.0 - uses: actions/checkout@v4 - id: dependency diff --git a/.github/workflows/pb-update-pipeline.yml b/.github/workflows/pb-update-pipeline.yml index a80569f..2c05223 100644 --- a/.github/workflows/pb-update-pipeline.yml +++ b/.github/workflows/pb-update-pipeline.yml @@ -16,7 +16,7 @@ jobs: steps: - uses: actions/setup-go@v5 with: - go-version: "1.20" + go-version: "1.22" - name: Install octo run: | #!/usr/bin/env bash @@ -55,6 +55,12 @@ jobs: ) git add .github/ + git add .gitignore + + if [ -f scripts/build.sh ]; then + git add scripts/build.sh + fi + git checkout -- . echo "old-version=${OLD_VERSION}" >> "$GITHUB_OUTPUT" 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/buildpack.toml b/buildpack.toml index e417c69..054d9f4 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -1,4 +1,4 @@ -# Copyright 2018-2023 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. @@ -28,7 +28,7 @@ api = "0.7" uri = "https://github.com/paketo-buildpacks/graalvm/blob/main/LICENSE" [metadata] - include-files = ["LICENSE", "NOTICE", "README.md", "bin/build", "bin/detect", "bin/helper", "bin/main", "buildpack.toml"] + include-files = ["LICENSE", "NOTICE", "README.md", "linux/amd64/bin/build", "linux/amd64/bin/detect", "linux/amd64/bin/main", "linux/amd64/bin/helper", "linux/arm64/bin/build", "linux/arm64/bin/detect", "linux/arm64/bin/main", "linux/arm64/bin/helper", "buildpack.toml"] pre-package = "scripts/build.sh" [[metadata.configurations]] @@ -136,7 +136,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:17.0.9:*:*:*:*:*:*:*:*"] id = "jdk" name = "GraalVM for JDK" - purl = "pkg:generic/graalvm-jdk@17.0.9" + purl = "pkg:generic/graalvm-jdk@17.0.9&arch=amd64" sha256 = "e47ba7229cef02393e19d5b8f46f7f1cab4829dd17bfe84d5431fc8ff0e22a96" source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-17.0.9.tar.gz" source-sha256 = "488b8d968a114f52606cab5e080b53d264e550c8f3e66993952363744df2b63e" @@ -152,7 +152,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:21.0.2:*:*:*:*:*:*:*:*"] id = "jdk" name = "GraalVM for JDK" - purl = "pkg:generic/graalvm-jdk@21.0.2" + purl = "pkg:generic/graalvm-jdk@21.0.2&arch=amd64" sha256 = "b048069aaa3a99b84f5b957b162cc181a32a4330cbc35402766363c5be76ae48" source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-21.0.2.tar.gz" source-sha256 = "a99dfd8246c0e6cbbf756e76f301426ea58eeb85da1b172a566e2ba3e1583e5a" @@ -168,7 +168,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:17.0.9:*:*:*:*:*:*:*:*"] id = "native-image-svm" name = "GraalVM for Native Image" - purl = "pkg:generic/graalvm-jdk@17.0.9" + purl = "pkg:generic/graalvm-jdk@17.0.9&arch=amd64" sha256 = "e47ba7229cef02393e19d5b8f46f7f1cab4829dd17bfe84d5431fc8ff0e22a96" source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-17.0.9.tar.gz" source-sha256 = "488b8d968a114f52606cab5e080b53d264e550c8f3e66993952363744df2b63e" @@ -184,7 +184,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:21.0.2:*:*:*:*:*:*:*:*"] id = "native-image-svm" name = "GraalVM for Native Image" - purl = "pkg:generic/graalvm-jdk@21.0.2" + purl = "pkg:generic/graalvm-jdk@21.0.2&arch=amd64" sha256 = "b048069aaa3a99b84f5b957b162cc181a32a4330cbc35402766363c5be76ae48" source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-21.0.2.tar.gz" source-sha256 = "a99dfd8246c0e6cbbf756e76f301426ea58eeb85da1b172a566e2ba3e1583e5a" @@ -196,5 +196,77 @@ api = "0.7" type = "GPL-2.0 WITH Classpath-exception-2.0" uri = "https://openjdk.java.net/legal/gplv2+ce.html" + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:17.0.9:*:*:*:*:*:*:*:*"] + id = "jdk" + name = "GraalVM for JDK" + purl = "pkg:generic/graalvm-jdk@17.0.9&arch=arm64" + sha256 = "c3281b21f5220c2f76cf6fa0d646bc42e2d729af2c022bb06e557a613ba16102" + source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-17.0.9.tar.gz" + source-sha256 = "488b8d968a114f52606cab5e080b53d264e550c8f3e66993952363744df2b63e" + stacks = ["*"] + uri = "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-aarch64_bin.tar.gz" + version = "17.0.9" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:21.0.2:*:*:*:*:*:*:*:*"] + id = "jdk" + name = "GraalVM for JDK" + purl = "pkg:generic/graalvm-jdk@21.0.2&arch=arm64" + sha256 = "a34be691ce68f0acf4655c7c6c63a9a49ed276a11859d7224fd94fc2f657cd7a" + source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-21.0.2.tar.gz" + source-sha256 = "a99dfd8246c0e6cbbf756e76f301426ea58eeb85da1b172a566e2ba3e1583e5a" + stacks = ["*"] + uri = "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-aarch64_bin.tar.gz" + version = "21.0.2" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:17.0.9:*:*:*:*:*:*:*:*"] + id = "native-image-svm" + name = "GraalVM for Native Image" + purl = "pkg:generic/graalvm-jdk@17.0.9&arch=arm64" + sha256 = "c3281b21f5220c2f76cf6fa0d646bc42e2d729af2c022bb06e557a613ba16102" + source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-17.0.9.tar.gz" + source-sha256 = "488b8d968a114f52606cab5e080b53d264e550c8f3e66993952363744df2b63e" + stacks = ["*"] + uri = "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-17.0.9/graalvm-community-jdk-17.0.9_linux-aarch64_bin.tar.gz" + version = "17.0.9" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:21.0.2:*:*:*:*:*:*:*:*"] + id = "native-image-svm" + name = "GraalVM for Native Image" + purl = "pkg:generic/graalvm-jdk@21.0.2&arch=arm64" + sha256 = "a34be691ce68f0acf4655c7c6c63a9a49ed276a11859d7224fd94fc2f657cd7a" + source = "https://github.com/graalvm/graalvm-ce-builds/archive/refs/tags/jdk-21.0.2.tar.gz" + source-sha256 = "a99dfd8246c0e6cbbf756e76f301426ea58eeb85da1b172a566e2ba3e1583e5a" + stacks = ["*"] + uri = "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.2/graalvm-community-jdk-21.0.2_linux-aarch64_bin.tar.gz" + version = "21.0.2" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://openjdk.java.net/legal/gplv2+ce.html" + [[stacks]] id = "*" + +[[targets]] + arch = "amd64" + os = "linux" + +[[targets]] + arch = "arm64" + os = "linux" \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build.sh index e6f39a2..8c3b942 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,17 +1,23 @@ #!/usr/bin/env bash - set -euo pipefail -GOOS="linux" go build -ldflags='-s -w' -o bin/helper github.com/paketo-buildpacks/libjvm/cmd/helper -GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/paketo-buildpacks/graalvm/v7/cmd/main +GOMOD=$(head -1 go.mod | awk '{print $2}') +GOOS="linux" GOARCH="amd64" go build -ldflags='-s -w' -o "linux/amd64/bin/helper" "github.com/paketo-buildpacks/libjvm/cmd/helper" +GOOS="linux" GOARCH="arm64" go build -ldflags='-s -w' -o "linux/arm64/bin/helper" "github.com/paketo-buildpacks/libjvm/cmd/helper" +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/helper bin/main + strip linux/amd64/bin/helper linux/arm64/bin/helper + strip linux/amd64/bin/main linux/arm64/bin/main fi if [ "${COMPRESS:-none}" != "none" ]; then - $COMPRESS bin/helper bin/main + $COMPRESS linux/amd64/bin/helper linux/arm64/bin/helper + $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