diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index d41dbb8..ab3bc1c 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" @@ -55,4 +58,42 @@ dependencies: uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main with: glob: amazon-corretto-[\d.-]+-linux-x64.tar.gz + repository: corretto-22 + +# ARM64 +- name: JDK 8 ARM64 + id: jdk + version_pattern: "^8\\.[\\d]+\\.[\\d]+" + cpe_pattern: "update[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-8 +- name: JDK 11 ARM64 + id: jdk + version_pattern: "11\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-11 +- name: JDK 17 ARM64 + id: jdk + version_pattern: "17\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-17 +- name: JDK 21 ARM64 + id: jdk + version_pattern: "21\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-21 +- name: JDK 22 ARM64 + id: jdk + version_pattern: "22\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz repository: corretto-22 \ No newline at end of file diff --git a/.github/workflows/pb-update-jdk-11-arm-64.yml b/.github/workflows/pb-update-jdk-11-arm-64.yml new file mode 100644 index 0000000..589da4a --- /dev/null +++ b/.github/workflows/pb-update-jdk-11-arm-64.yml @@ -0,0 +1,103 @@ +name: Update JDK 11 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.20" + - 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.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-11 + - 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: "" + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + 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: 11\.[\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 11 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-11-arm-64 + commit-message: |- + Bump JDK 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 11 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 11 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-arm-64.yml b/.github/workflows/pb-update-jdk-17-arm-64.yml new file mode 100644 index 0000000..d8a6ee1 --- /dev/null +++ b/.github/workflows/pb-update-jdk-17-arm-64.yml @@ -0,0 +1,103 @@ +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.20" + - 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.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-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: "" + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + 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-21-arm-64.yml b/.github/workflows/pb-update-jdk-21-arm-64.yml new file mode 100644 index 0000000..d334688 --- /dev/null +++ b/.github/workflows/pb-update-jdk-21-arm-64.yml @@ -0,0 +1,103 @@ +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.20" + - 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.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-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: "" + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + 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-22-arm-64.yml b/.github/workflows/pb-update-jdk-22-arm-64.yml new file mode 100644 index 0000000..cb58793 --- /dev/null +++ b/.github/workflows/pb-update-jdk-22-arm-64.yml @@ -0,0 +1,103 @@ +name: Update JDK 22 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.20" + - 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.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-22 + - 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: "" + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: "" + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + 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: 22\.[\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 22 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-22-arm-64 + commit-message: |- + Bump JDK 22 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 22 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 22 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-8-arm-64.yml b/.github/workflows/pb-update-jdk-8-arm-64.yml new file mode 100644 index 0000000..d86be92 --- /dev/null +++ b/.github/workflows/pb-update-jdk-8-arm-64.yml @@ -0,0 +1,103 @@ +name: Update JDK 8 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.20" + - 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.5.3 + with: + crane-version: 0.19.0 + yj-version: 5.1.0 + - uses: actions/checkout@v4 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/amazon-corretto-dependency:main + with: + glob: amazon-corretto-[\d.-]+-linux-aarch64.tar.gz + repository: corretto-8 + - 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: "" + CPE: ${{ steps.dependency.outputs.cpe }} + CPE_PATTERN: update[\d]+ + ID: jdk + PURL: ${{ steps.dependency.outputs.purl }} + PURL_PATTERN: "" + 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: ^8\.[\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 8 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jdk-8-arm-64 + commit-message: |- + Bump JDK 8 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JDK 8 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 8 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} 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 897a837..69dd621 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -27,8 +27,17 @@ api = "0.7" type = "Apache-2.0" uri = "https://github.com/paketo-buildpacks/amazon-corretto/blob/main/LICENSE" +[[targets]] +os = "linux" +arch = "amd64" + +[[targets]] +os = "linux" +arch = "arm64" + + [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]] @@ -142,7 +151,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:1.8.0:update412:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:1.8.0:update412:*:*:*:*:*:*:*"] id = "jdk" name = "Corretto JDK" - purl = "pkg:generic/amazon/corretto-jdk@8.0.402" + purl = "pkg:generic/amazon/corretto-jdk@8.0.402?arch=amd4" sha256 = "f3061601f1774aa0a52804a4a744b8c3eae93a9e6d289ad80576faa3e8d99cb1" source = "https://github.com/corretto/corretto-8/archive/refs/tags/8.412.08.1.tar.gz" source-sha256 = "920829e59916a634b2aa4e8b6a2c4b3fbec2afcdc7a95df1d3a4ec7ceeb561b0" @@ -158,7 +167,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:11.0.23:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:11.0.23:*:*:*:*:*:*:*"] id = "jdk" name = "Corretto JDK" - purl = "pkg:generic/amazon/corretto-jdk@11.0.23" + purl = "pkg:generic/amazon/corretto-jdk@11.0.23?arch=amd4" sha256 = "008fae961dfd0df99cbc888a0279561458fe830797646234efe7daed8e512040" source = "https://github.com/corretto/corretto-11/archive/refs/tags/11.0.23.9.1.tar.gz" source-sha256 = "40b085766025c363a599e4849c86d7520651d2cbb48e22b633ea5fd5f5401ecb" @@ -174,7 +183,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:17.0.11:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:17.0.11:*:*:*:*:*:*:*"] id = "jdk" name = "Corretto JDK" - purl = "pkg:generic/amazon/corretto-jdk@17.0.11" + purl = "pkg:generic/amazon/corretto-jdk@17.0.11?arch=amd4" sha256 = "7629d3446ebeaf7517a90a4f170d38fc8628725430d2300153b5981872e1223a" source = "https://github.com/corretto/corretto-17/archive/refs/tags/17.0.11.9.1.tar.gz" source-sha256 = "d051e2de73355ff148c326e687411aada9aaa8d078b8d8cc2daef8869577e905" @@ -190,7 +199,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:21.0.3:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:21.0.3:*:*:*:*:*:*:*"] id = "jdk" name = "Corretto JDK" - purl = "pkg:generic/amazon/corretto-jdk@21.0.3" + purl = "pkg:generic/amazon/corretto-jdk@21.0.3?arch=amd4" sha256 = "8b4550c7cbbe3ae8b00adaafe5513d1236eec8183ce28f99698450f4f802c597" source = "https://github.com/corretto/corretto-21/archive/refs/tags/21.0.3.9.1.tar.gz" source-sha256 = "55a259d8a24983cbc17d74b1a3c0b0ea0424762852c3ae1052c2f6bf278a061d" @@ -206,7 +215,7 @@ api = "0.7" cpes = ["cpe:2.3:a:oracle:jdk:22.0.1:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:22.0.1:*:*:*:*:*:*:*"] id = "jdk" name = "Corretto JDK" - purl = "pkg:generic/amazon/corretto-jdk@22.0.1" + purl = "pkg:generic/amazon/corretto-jdk@22.0.1?arch=amd4" sha256 = "b840a424ef007c2951e7af3562492e67e984e311c978a6cbbbb60c36421f67ae" source = "https://github.com/corretto/corretto-22/archive/refs/tags/22.0.1.8.1.tar.gz" source-sha256 = "ae9c2ca3d7a3ec4e8385eff60ed110f54cf955149556baf5764ee104a0684cd1" @@ -218,5 +227,85 @@ api = "0.7" type = "GPL-2.0 WITH Classpath-exception-2.0" uri = "https://aws.amazon.com/corretto/faqs/#Licensing_and_Open_Source" + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:1.8.0:update412:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:1.8.0:update412:*:*:*:*:*:*:*"] + id = "jdk" + name = "Corretto JDK" + purl = "pkg:generic/amazon/corretto-jdk@8.0.402?arch=arm64" + sha256 = "blank" + source = "https://github.com/corretto/corretto-8/archive/refs/tags/8.412.08.1.tar.gz" + source-sha256 = "920829e59916a634b2aa4e8b6a2c4b3fbec2afcdc7a95df1d3a4ec7ceeb561b0" + stacks = ["*"] + uri = "https://corretto.aws/downloads/resources/8.412.08.1/amazon-corretto-8.412.08.1-linux-aarch64.tar.gz" + version = "8.0.412" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://aws.amazon.com/corretto/faqs/#Licensing_and_Open_Source" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:11.0.23:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:11.0.23:*:*:*:*:*:*:*"] + id = "jdk" + name = "Corretto JDK" + purl = "pkg:generic/amazon/corretto-jdk@11.0.23?arch=arm64" + sha256 = "blank" + source = "https://github.com/corretto/corretto-11/archive/refs/tags/11.0.23.9.1.tar.gz" + source-sha256 = "40b085766025c363a599e4849c86d7520651d2cbb48e22b633ea5fd5f5401ecb" + stacks = ["*"] + uri = "https://corretto.aws/downloads/resources/11.0.23.9.1/amazon-corretto-11.0.23.9.1-linux-aarch64.tar.gz" + version = "11.0.23" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://aws.amazon.com/corretto/faqs/#Licensing_and_Open_Source" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:17.0.11:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:17.0.11:*:*:*:*:*:*:*"] + id = "jdk" + name = "Corretto JDK" + purl = "pkg:generic/amazon/corretto-jdk@17.0.11?arch=arm64" + sha256 = "blank" + source = "https://github.com/corretto/corretto-17/archive/refs/tags/17.0.11.9.1.tar.gz" + source-sha256 = "d051e2de73355ff148c326e687411aada9aaa8d078b8d8cc2daef8869577e905" + stacks = ["*"] + uri = "https://corretto.aws/downloads/resources/17.0.11.9.1/amazon-corretto-17.0.11.9.1-linux-aarch64.tar.gz" + version = "17.0.11" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://aws.amazon.com/corretto/faqs/#Licensing_and_Open_Source" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:21.0.3:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:21.0.3:*:*:*:*:*:*:*"] + id = "jdk" + name = "Corretto JDK" + purl = "pkg:generic/amazon/corretto-jdk@21.0.3?arch=arm64" + sha256 = "blank" + source = "https://github.com/corretto/corretto-21/archive/refs/tags/21.0.3.9.1.tar.gz" + source-sha256 = "55a259d8a24983cbc17d74b1a3c0b0ea0424762852c3ae1052c2f6bf278a061d" + stacks = ["*"] + uri = "https://corretto.aws/downloads/resources/21.0.3.9.1/amazon-corretto-21.0.3.9.1-linux-aarch64.tar.gz" + version = "21.0.3" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://aws.amazon.com/corretto/faqs/#Licensing_and_Open_Source" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:oracle:jdk:22.0.1:*:*:*:*:*:*:*", "cpe:2.3:a:amazon:corretto:22.0.1:*:*:*:*:*:*:*"] + id = "jdk" + name = "Corretto JDK" + purl = "pkg:generic/amazon/corretto-jdk@22.0.1?arch=arm64" + sha256 = "blank" + source = "https://github.com/corretto/corretto-22/archive/refs/tags/22.0.1.8.1.tar.gz" + source-sha256 = "ae9c2ca3d7a3ec4e8385eff60ed110f54cf955149556baf5764ee104a0684cd1" + stacks = ["*"] + uri = "https://corretto.aws/downloads/resources/22.0.1.8.1/amazon-corretto-22.0.1.8.1-linux-aarch64.tar.gz" + version = "22.0.1" + + [[metadata.dependencies.licenses]] + type = "GPL-2.0 WITH Classpath-exception-2.0" + uri = "https://aws.amazon.com/corretto/faqs/#Licensing_and_Open_Source" + [[stacks]] id = "*" diff --git a/scripts/build.sh b/scripts/build.sh index 1d6f16b..ba5dfdc 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/amazon-corretto/v7/cmd/main +GOMOD=$(head -1 go.mod | awk '{print $2}') +GOOS="linux" 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" 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