From 7c309a2db8de54efd3e4b6d4fd1e186544a673b9 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 21:27:30 -0400 Subject: [PATCH 1/8] Add helper and update pipeline Signed-off-by: Daniel Mikusa --- .github/pipeline-descriptor.yml | 3 +++ .gitignore | 2 ++ scripts/build.sh | 20 +++++++++++++------- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index 35a6404..e114a3a 100644 --- a/.github/pipeline-descriptor.yml +++ b/.github/pipeline-descriptor.yml @@ -6,6 +6,9 @@ codeowners: - path: "*" owner: "@paketo-buildpacks/java-maintainers" +helpers: + "bin/helper": "github.com/paketo-buildpacks/libjvm/cmd/helper" + package: repositories: ["docker.io/paketobuildpacks/eclipse-openj9", "gcr.io/paketo-buildpacks/eclipse-openj9"] register: true 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 b82b390..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/eclipse-openj9/v9/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 From f514d20887019b360ba1f707e5f37c9fb344e2d7 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 21:37:59 -0400 Subject: [PATCH 2/8] Run with latest octo Signed-off-by: Daniel Mikusa --- .github/workflows/pb-create-package.yml | 2 +- .github/workflows/pb-tests.yml | 2 +- scripts/build.sh | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pb-create-package.yml b/.github/workflows/pb-create-package.yml index c0216ae..5cea42b 100644 --- a/.github/workflows/pb-create-package.yml +++ b/.github/workflows/pb-create-package.yml @@ -188,7 +188,7 @@ jobs: else pack -v buildpack package \ "${PACKAGE}:${VERSION}" ${CONFIG} \ - --format "${FORMAT}" + --format "${FORMAT}" $([ -n "$TTL_SH_PUBLISH" ] && [ "$TTL_SH_PUBLISH" = "true" ] && echo "--publish") fi env: PACKAGES: docker.io/paketobuildpacks/eclipse-openj9 gcr.io/paketo-buildpacks/eclipse-openj9 diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index ea688a4..d0a9087 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -173,7 +173,7 @@ jobs: else pack -v buildpack package \ "${PACKAGE}:${VERSION}" ${CONFIG} \ - --format "${FORMAT}" + --format "${FORMAT}" $([ -n "$TTL_SH_PUBLISH" ] && [ "$TTL_SH_PUBLISH" = "true" ] && echo "--publish") fi env: FORMAT: image diff --git a/scripts/build.sh b/scripts/build.sh index ba5dfdc..8c3b942 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,9 +2,9 @@ set -euo pipefail 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="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" go build -ldflags='-s -w' -o linux/amd64/bin/main "$GOMOD/cmd/main" +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 From 5ecbcdc807044fc414b2af6ab6e2b5b0c4fbb267 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 21:43:19 -0400 Subject: [PATCH 3/8] Add debug Signed-off-by: Daniel Mikusa --- .github/workflows/pb-create-package.yml | 2 +- scripts/build.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pb-create-package.yml b/.github/workflows/pb-create-package.yml index 5cea42b..581f921 100644 --- a/.github/workflows/pb-create-package.yml +++ b/.github/workflows/pb-create-package.yml @@ -116,7 +116,7 @@ jobs: export CGO_ENABLED=0 if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then - create-package \ + BP_DEBUG=true create-package \ --source "${SOURCE_PATH:-.}" \ --cache-location "${HOME}"/carton-cache \ --destination "${HOME}"/buildpack \ diff --git a/scripts/build.sh b/scripts/build.sh index 8c3b942..e20ae14 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -20,4 +20,8 @@ fi 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 +ln -fs main linux/arm64/bin/detect + +echo "END" +ls -lR linux/ + From 17497a88b45141d812e2d1bde5f51fb95c1aa8a9 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 21:46:09 -0400 Subject: [PATCH 4/8] More debug Signed-off-by: Daniel Mikusa --- .github/workflows/pb-create-package.yml | 2 +- .github/workflows/pb-tests.yml | 2 +- scripts/build.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pb-create-package.yml b/.github/workflows/pb-create-package.yml index 581f921..5cea42b 100644 --- a/.github/workflows/pb-create-package.yml +++ b/.github/workflows/pb-create-package.yml @@ -116,7 +116,7 @@ jobs: export CGO_ENABLED=0 if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then - BP_DEBUG=true create-package \ + create-package \ --source "${SOURCE_PATH:-.}" \ --cache-location "${HOME}"/carton-cache \ --destination "${HOME}"/buildpack \ diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index d0a9087..a99e96a 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -103,7 +103,7 @@ jobs: export CGO_ENABLED=0 if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then - create-package \ + BP_DEBUG=true create-package \ --source "${SOURCE_PATH:-.}" \ --cache-location "${HOME}"/carton-cache \ --destination "${HOME}"/buildpack \ diff --git a/scripts/build.sh b/scripts/build.sh index e20ae14..e8023df 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -24,4 +24,4 @@ ln -fs main linux/arm64/bin/detect echo "END" ls -lR linux/ - +ls -lR bin/ From eb9f4d8d85fd5e5bd01de93bb6525f8eb0aded60 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 22:08:10 -0400 Subject: [PATCH 5/8] Add ARM64 binaries Signed-off-by: Daniel Mikusa --- .github/pipeline-descriptor.yml | 97 +++++++++++++ .github/workflows/pb-tests.yml | 2 +- .github/workflows/pb-update-jdk-11-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jdk-17-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jdk-21-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jdk-8-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jre-11-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jre-17-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jre-21-arm-64.yml | 107 ++++++++++++++ .github/workflows/pb-update-jre-8-arm-64.yml | 107 ++++++++++++++ buildpack.toml | 136 ++++++++++++++++++ scripts/build.sh | 6 +- 12 files changed, 1091 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/pb-update-jdk-11-arm-64.yml 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-jdk-8-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-11-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-17-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-21-arm-64.yml create mode 100644 .github/workflows/pb-update-jre-8-arm-64.yml diff --git a/.github/pipeline-descriptor.yml b/.github/pipeline-descriptor.yml index e114a3a..9f9c617 100644 --- a/.github/pipeline-descriptor.yml +++ b/.github/pipeline-descriptor.yml @@ -111,3 +111,100 @@ dependencies: repository: semeru21-binaries tag_filter: jdk(.*21.*) token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} +# ARM64 +- name: JDK 8 ARM64 + id: jdk + version_pattern: "^8(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru8-binaries + tag_filter: jdk(.*8.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JRE 8 ARM64 + id: jre + version_pattern: "^8(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru8-binaries + tag_filter: jdk(.*8.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JDK 11 ARM64 + id: jdk + version_pattern: "^11(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru11-binaries + tag_filter: jdk(.*11.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JRE 11 ARM64 + id: jre + version_pattern: "^11(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru11-binaries + tag_filter: jdk(.*11.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JDK 17 ARM64 + id: jdk + version_pattern: "^17(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru17-binaries + tag_filter: jdk(.*17.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JRE 17 ARM64 + id: jre + version_pattern: "^17(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru17-binaries + tag_filter: jdk(.*17.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JDK 21 ARM64 + id: jdk + version_pattern: "^21(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru21-binaries + tag_filter: jdk(.*21.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 +- name: JRE 21 ARM64 + id: jre + version_pattern: "^21(?:\\.[\\d]+(?:\\.[\\d]+)?)?" + cpe_pattern: "[\\d]+\\.[\\d]+\\.[\\d]+" + uses: docker://ghcr.io/paketo-buildpacks/actions/ibm-semeru-dependency:main + with: + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru21-binaries + tag_filter: jdk(.*21.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + arch: arm64 \ No newline at end of file diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index a99e96a..d0a9087 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -103,7 +103,7 @@ jobs: export CGO_ENABLED=0 if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then - BP_DEBUG=true create-package \ + create-package \ --source "${SOURCE_PATH:-.}" \ --cache-location "${HOME}"/carton-cache \ --destination "${HOME}"/buildpack \ 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..e65b2a4 --- /dev/null +++ b/.github/workflows/pb-update-jdk-11-arm-64.yml @@ -0,0 +1,107 @@ +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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru11-binaries + tag_filter: jdk(.*11.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\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: ^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..f0ef61d --- /dev/null +++ b/.github/workflows/pb-update-jdk-17-arm-64.yml @@ -0,0 +1,107 @@ +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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru17-binaries + tag_filter: jdk(.*17.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\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: ^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..67af32b --- /dev/null +++ b/.github/workflows/pb-update-jdk-21-arm-64.yml @@ -0,0 +1,107 @@ +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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru21-binaries + tag_filter: jdk(.*21.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\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: ^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-8-arm-64.yml b/.github/workflows/pb-update-jdk-8-arm-64.yml new file mode 100644 index 0000000..d92982b --- /dev/null +++ b/.github/workflows/pb-update-jdk-8-arm-64.yml @@ -0,0 +1,107 @@ +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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jdk_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru8-binaries + tag_filter: jdk(.*8.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\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/.github/workflows/pb-update-jre-11-arm-64.yml b/.github/workflows/pb-update-jre-11-arm-64.yml new file mode 100644 index 0000000..041a7b6 --- /dev/null +++ b/.github/workflows/pb-update-jre-11-arm-64.yml @@ -0,0 +1,107 @@ +name: Update JRE 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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru11-binaries + tag_filter: jdk(.*11.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\d]+' + ID: jre + 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 `JRE 11 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-11-arm-64 + commit-message: |- + Bump JRE 11 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 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 JRE 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-jre-17-arm-64.yml b/.github/workflows/pb-update-jre-17-arm-64.yml new file mode 100644 index 0000000..5961232 --- /dev/null +++ b/.github/workflows/pb-update-jre-17-arm-64.yml @@ -0,0 +1,107 @@ +name: Update JRE 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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru17-binaries + tag_filter: jdk(.*17.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\d]+' + ID: jre + 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 `JRE 17 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-17-arm-64 + commit-message: |- + Bump JRE 17 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 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 JRE 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-jre-21-arm-64.yml b/.github/workflows/pb-update-jre-21-arm-64.yml new file mode 100644 index 0000000..070b40d --- /dev/null +++ b/.github/workflows/pb-update-jre-21-arm-64.yml @@ -0,0 +1,107 @@ +name: Update JRE 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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru21-binaries + tag_filter: jdk(.*21.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\d]+' + ID: jre + 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 `JRE 21 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-21-arm-64 + commit-message: |- + Bump JRE 21 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 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 JRE 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-jre-8-arm-64.yml b/.github/workflows/pb-update-jre-8-arm-64.yml new file mode 100644 index 0000000..eebad95 --- /dev/null +++ b/.github/workflows/pb-update-jre-8-arm-64.yml @@ -0,0 +1,107 @@ +name: Update JRE 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/ibm-semeru-dependency:main + with: + arch: arm64 + glob: ibm-semeru-open-jre_aarch64_linux_.+_openj9-.+.tar.gz + owner: ibmruntimes + repository: semeru8-binaries + tag_filter: jdk(.*8.*) + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} + - 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: '[\d]+\.[\d]+\.[\d]+' + ID: jre + 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 `JRE 8 ARM64` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/jre-8-arm-64 + commit-message: |- + Bump JRE 8 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps JRE 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 JRE 8 ARM64 from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.PAKETO_BOT_GITHUB_TOKEN }} diff --git a/buildpack.toml b/buildpack.toml index ea0ce1e..1094745 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -242,5 +242,141 @@ api = "0.7" type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jdk" + name = "OpenJ9 JDK" + purl = "pkg:generic/ibmruntimes/semeru-jdk@8.0.402?arch=arm64" + sha256 = "eee642d945d249f9aa2bba0b788a7d79d4989a32205b18e6bb075b50e77d700a" + source = "https://github.com/ibmruntimes/semeru8-binaries/archive/refs/tags/jdk8u402-b06_openj9-0.43.0.tar.gz" + source-sha256 = "859745cc715bd21f770c59896e619bad431b13d507359e35f5282d57f812e0af" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u402-b06_openj9-0.43.0/ibm-semeru-open-jdk_aarch64_linux_8u402b06_openj9-0.43.0.tar.gz" + version = "8.0.402" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jre" + name = "OpenJ9 JRE" + purl = "pkg:generic/ibmruntimes/semeru-jre@8.0.402?arch=arm64" + sha256 = "4921671d26754483f096007cfb537922f1b190ca471aaebda6eccdefe91f7fb0" + source = "https://github.com/ibmruntimes/semeru8-binaries/archive/refs/tags/jdk8u402-b06_openj9-0.43.0.tar.gz" + source-sha256 = "859745cc715bd21f770c59896e619bad431b13d507359e35f5282d57f812e0af" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru8-binaries/releases/download/jdk8u402-b06_openj9-0.43.0/ibm-semeru-open-jre_aarch64_linux_8u402b06_openj9-0.43.0.tar.gz" + version = "8.0.402" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jdk" + name = "OpenJ9 JDK" + purl = "pkg:generic/ibmruntimes/semeru-jdk@11.0.22?arch=arm64" + sha256 = "8462e525d9fb3ac0d1a3915f859175450da58958a1257cb37fe9cbde57c03eb8" + source = "https://github.com/ibmruntimes/semeru11-binaries/archive/refs/tags/jdk-11.0.22+7_openj9-0.43.0.tar.gz" + source-sha256 = "8d30c077e9c88d9b184d23575744c462a3fbce9415d0ac501c9d1f821eb16c2b" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B7_openj9-0.43.0/ibm-semeru-open-jdk_aarch64_linux_11.0.22_7_openj9-0.43.0.tar.gz" + version = "11.0.22" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jre" + name = "OpenJ9 JRE" + purl = "pkg:generic/ibmruntimes/semeru-jre@11.0.17?arch=arm64" + sha256 = "cf723eca95f805d5ba0dfc33aa798ccd9f2a1984d2dc72c0b2fed5df804e8edf" + source = "https://github.com/ibmruntimes/semeru11-binaries/archive/refs/tags/jdk-11.0.22+7_openj9-0.43.0.tar.gz" + source-sha256 = "8d30c077e9c88d9b184d23575744c462a3fbce9415d0ac501c9d1f821eb16c2b" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru11-binaries/releases/download/jdk-11.0.22%2B7_openj9-0.43.0/ibm-semeru-open-jre_aarch64_linux_11.0.22_7_openj9-0.43.0.tar.gz" + version = "11.0.22" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jdk" + name = "OpenJ9 JDK" + purl = "pkg:generic/ibmruntimes/semeru-jdk@17.0.10?arch=arm64" + sha256 = "408a17ca19c74d29d60d1659e7b14bb81bb44d7f9ca992d1fd6bec96de7d9aa7" + source = "https://github.com/ibmruntimes/semeru17-binaries/archive/refs/tags/jdk-17.0.10+7_openj9-0.43.0.tar.gz" + source-sha256 = "efa6ab578a7658f9700a7ba9cb58f2db4ae2e8d5497121198b16e1b8717d89b7" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.10%2B7_openj9-0.43.0/ibm-semeru-open-jdk_aarch64_linux_17.0.10_7_openj9-0.43.0.tar.gz" + version = "17.0.10" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jre" + name = "OpenJ9 JRE" + purl = "pkg:generic/ibmruntimes/semeru-jre@17.0.10?arch=arm64" + sha256 = "ee2f15b9f0719eccf8e7d51404f1187c754dec55ef546b469786a72e1e9e1480" + source = "https://github.com/ibmruntimes/semeru17-binaries/archive/refs/tags/jdk-17.0.10+7_openj9-0.43.0.tar.gz" + source-sha256 = "efa6ab578a7658f9700a7ba9cb58f2db4ae2e8d5497121198b16e1b8717d89b7" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru17-binaries/releases/download/jdk-17.0.10%2B7_openj9-0.43.0/ibm-semeru-open-jre_aarch64_linux_17.0.10_7_openj9-0.43.0.tar.gz" + version = "17.0.10" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jdk" + name = "OpenJ9 JDK" + purl = "pkg:generic/ibmruntimes/semeru-jdk@21.0.2?arch=arm64" + sha256 = "6404c5fe4a71049d4f80429720b7d3f3e3b0ebea8067b823a6bfb24b9fe69797" + source = "https://github.com/ibmruntimes/semeru21-binaries/archive/refs/tags/jdk-21.0.2+13_openj9-0.43.0.tar.gz" + source-sha256 = "244e2fd808ec6a4a55e8ef28484594ead421cc00139f8294a865f9fe0a86d29f" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru21-binaries/releases/download/jdk-21.0.2%2B13_openj9-0.43.0/ibm-semeru-open-jdk_aarch64_linux_21.0.2_13_openj9-0.43.0.tar.gz" + version = "21.0.2" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + + [[metadata.dependencies]] + cpes = ["cpe:2.3:a:eclipse:openj9:0.43.0:*:*:*:*:*:*:*"] + id = "jre" + name = "OpenJ9 JRE" + purl = "pkg:generic/ibmruntimes/semeru-jre@21.0.2?arch=arm64" + sha256 = "d89507e6d05132106122894b76e2e466521be047c928faf3d47827b3343c3631" + source = "https://github.com/ibmruntimes/semeru21-binaries/archive/refs/tags/jdk-21.0.2+13_openj9-0.43.0.tar.gz" + source-sha256 = "244e2fd808ec6a4a55e8ef28484594ead421cc00139f8294a865f9fe0a86d29f" + stacks = ["*"] + uri = "https://github.com/ibmruntimes/semeru21-binaries/releases/download/jdk-21.0.2%2B13_openj9-0.43.0/ibm-semeru-open-jre_aarch64_linux_21.0.2_13_openj9-0.43.0.tar.gz" + version = "21.0.2" + + [[metadata.dependencies.licenses]] + type = "EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception" + uri = "https://github.com/eclipse/openj9/blob/master/LICENSE" + [[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 e8023df..8c3b942 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -20,8 +20,4 @@ fi 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 - -echo "END" -ls -lR linux/ -ls -lR bin/ +ln -fs main linux/arm64/bin/detect \ No newline at end of file From 31db09f392bddbe56ecd96199fe7da0679ee28a9 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 22:09:37 -0400 Subject: [PATCH 6/8] Update include-files Signed-off-by: Daniel Mikusa --- buildpack.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildpack.toml b/buildpack.toml index 1094745..4f17913 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -28,7 +28,7 @@ api = "0.7" uri = "https://github.com/paketo-buildpacks/eclipse-openj9/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]] From 5ddccd63ce78ee665a5b934bf7fa8359b87e838e Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 22:17:25 -0400 Subject: [PATCH 7/8] Set TTL_SH_PUBLISH always Signed-off-by: Daniel Mikusa --- .github/workflows/pb-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index d0a9087..06456f6 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -178,6 +178,7 @@ jobs: env: FORMAT: image PACKAGES: test + TTL_SH_PUBLISH: "true" VERSION: ${{ steps.version.outputs.version }} unit: name: Unit Test From da2c69c78f8753ab5e7c222595fc5e63b560f291 Mon Sep 17 00:00:00 2001 From: Daniel Mikusa Date: Tue, 14 May 2024 22:18:14 -0400 Subject: [PATCH 8/8] Set TTL_SH_PUBLISH to false Signed-off-by: Daniel Mikusa --- .github/workflows/pb-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pb-tests.yml b/.github/workflows/pb-tests.yml index 06456f6..4fe4d4d 100644 --- a/.github/workflows/pb-tests.yml +++ b/.github/workflows/pb-tests.yml @@ -178,7 +178,7 @@ jobs: env: FORMAT: image PACKAGES: test - TTL_SH_PUBLISH: "true" + TTL_SH_PUBLISH: "false" VERSION: ${{ steps.version.outputs.version }} unit: name: Unit Test