Skip to content

Commit

Permalink
improvement(jib): update JDK LTS versions to the latest stable builds (
Browse files Browse the repository at this point in the history
…#5970)

* improvement(jib): update JDK 21 LTS version to `21.0.3+9`

* refactor(jib): ability to override base url for concrete JDK binary

* improvement(jib): update JDK 17 LTS version to `17.0.9+9`
  • Loading branch information
vvagaytsev committed Apr 25, 2024
1 parent 456e89e commit a333a9e
Showing 1 changed file with 35 additions and 29 deletions.
64 changes: 35 additions & 29 deletions plugins/jib/src/openjdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { posix } from "path"
interface JdkBinary {
filename: string
sha256: string
baseUrlOverride?: string
}

interface JdkVersion {
Expand Down Expand Up @@ -99,68 +100,73 @@ const jdk13Version: JdkVersion = {
},
}

const jdk17VersionName = "jdk-17.0.4.1+1"
const jdk17VersionName = "jdk-17.0.9+9"
const jdk17Version: JdkVersion = {
lookupName: "openjdk-17",
description: `The OpenJDK 17 library, ${jdk17VersionName}`,
baseUrl: "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.4.1%2B1/",
baseUrl: "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9/",
versionName: jdk17VersionName,
mac_amd64: {
filename: "OpenJDK17U-jdk_x64_mac_hotspot_17.0.4.1_1.tar.gz",
sha256: "ac21a5a87f7cfa00212ab7c41f7eb80ca33640d83b63ad850be811c24095d61a",
filename: "OpenJDK17U-jdk_x64_mac_hotspot_17.0.9_9.tar.gz",
sha256: "c69b37ea72136df49ce54972408803584b49b2c91b0fbc876d7125e963c7db37",
},
mac_arm64: {
filename: "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.4.1_1.tar.gz",
sha256: "3a976943a9e6a635e68e2b06bd093fc096aad9f5894acda673d3bea0cb3a6f38",
filename: "OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.9_9.tar.gz",
sha256: "823777266415347983bbd87ccd8136537242ff27e62f307b7e8521494c665f0d",
},
linux_amd64: {
filename: "OpenJDK17U-jdk_x64_linux_hotspot_17.0.4.1_1.tar.gz",
sha256: "5fbf8b62c44f10be2efab97c5f5dbf15b74fae31e451ec10abbc74e54a04ff44",
filename: "OpenJDK17U-jdk_x64_linux_hotspot_17.0.9_9.tar.gz",
sha256: "7b175dbe0d6e3c9c23b6ed96449b018308d8fc94a5ecd9c0df8b8bc376c3c18a",
},
linux_arm64: {
filename: "OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.4.1_1.tar.gz",
sha256: "3c7460de77421284b38b4e57cb1bd584a6cef55c34fc51a12270620544de2b8a",
filename: "OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.9_9.tar.gz",
sha256: "e2c5e26f8572544b201bc22a9b28f2b1a3147ab69be111cea07c7f52af252e75",
},
windows: {
filename: "OpenJDK17U-jdk_x64_windows_hotspot_17.0.4.1_1.zip",
sha256: "3860d2ed7405674baeb0f9f4c71377421716759fe4301e92bdd4dd43c0442dc3",
baseUrlOverride: "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.9%2B9.1/",
filename: "OpenJDK17U-jdk_x64_windows_hotspot_17.0.9_9.zip",
sha256: "d1b2bb5a074ba33a0cf4e84aa558f7a563b827f999a71c8e47bdb0dd02af6b9c",
},
}

const jdk21VersionName = "jdk-21.0.1+12"
const jdk21VersionName = "jdk-21.0.3+9"
const jdk21Version: JdkVersion = {
lookupName: "openjdk-21",
description: `The OpenJDK 21 library, ${jdk21VersionName}`,
baseUrl: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.1%2B12/",
baseUrl: "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.3%2B9/",
versionName: jdk21VersionName,
mac_amd64: {
filename: "OpenJDK21U-jdk_x64_mac_hotspot_21.0.1_12.tar.gz",
sha256: "35f3cbc86d7ff0a01facefd741d5cfb675867e0a5ec137f62ba071d2511a45c9",
filename: "OpenJDK21U-jdk_x64_mac_hotspot_21.0.3_9.tar.gz",
sha256: "f777103aab94330d14a29bd99f3a26d60abbab8e2c375cec9602746096721a7c",
},
mac_arm64: {
filename: "OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.1_12.tar.gz",
sha256: "0d29257c9bcb5f20f5c4643ef9437f36b10376863eddaf6248d09093796c6b30",
filename: "OpenJDK21U-jdk_aarch64_mac_hotspot_21.0.3_9.tar.gz",
sha256: "b6be6a9568be83695ec6b7cb977f4902f7be47d74494c290bc2a5c3c951e254f",
},
linux_amd64: {
filename: "OpenJDK21U-jdk_x64_linux_hotspot_21.0.1_12.tar.gz",
sha256: "1a6fa8abda4c5caed915cfbeeb176e7fbd12eb6b222f26e290ee45808b529aa1",
filename: "OpenJDK21U-jdk_x64_linux_hotspot_21.0.3_9.tar.gz",
sha256: "fffa52c22d797b715a962e6c8d11ec7d79b90dd819b5bc51d62137ea4b22a340",
},
linux_arm64: {
filename: "OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.1_12.tar.gz",
sha256: "e184dc29a6712c1f78754ab36fb48866583665fa345324f1a79e569c064f95e9",
filename: "OpenJDK21U-jdk_aarch64_linux_hotspot_21.0.3_9.tar.gz",
sha256: "7d3ab0e8eba95bd682cfda8041c6cb6fa21e09d0d9131316fd7c96c78969de31",
},
windows: {
filename: "OpenJDK21U-jdk_x64_windows_hotspot_21.0.1_12.zip",
sha256: "36555fd6a1a628abf8063b7781309895a94680c13a0e620013ff44bfdc18d8bd",
filename: "OpenJDK21U-jdk_x64_windows_hotspot_21.0.3_9.zip",
sha256: "c43a66cff7a403d56c5c5e1ff10d3d5f95961abf80f97f0e35380594909f0e4d",
},
}

function getUrl(jdkVersion: JdkVersion, jdkBinary: JdkBinary): string {
return (jdkBinary.baseUrlOverride ?? jdkVersion.baseUrl) + jdkBinary.filename
}

function openJdkSpec(jdkVersion: JdkVersion): PluginToolSpec {
const macBuilds: ToolBuildSpec[] = [
{
platform: "darwin",
architecture: "amd64",
url: jdkVersion.baseUrl + jdkVersion.mac_amd64.filename,
url: getUrl(jdkVersion, jdkVersion.mac_amd64),
sha256: jdkVersion.mac_amd64.sha256,
extract: {
format: "tar",
Expand All @@ -173,7 +179,7 @@ function openJdkSpec(jdkVersion: JdkVersion): PluginToolSpec {
macBuilds.push({
platform: "darwin",
architecture: "arm64",
url: jdkVersion.baseUrl + jdkVersion.mac_arm64.filename,
url: getUrl(jdkVersion, jdkVersion.mac_arm64),
sha256: jdkVersion.mac_arm64.sha256,
extract: {
format: "tar",
Expand All @@ -191,7 +197,7 @@ function openJdkSpec(jdkVersion: JdkVersion): PluginToolSpec {
{
platform: "linux",
architecture: "amd64",
url: jdkVersion.baseUrl + jdkVersion.linux_amd64.filename,
url: getUrl(jdkVersion, jdkVersion.linux_amd64),
sha256: jdkVersion.linux_amd64.sha256,
extract: {
format: "tar",
Expand All @@ -201,7 +207,7 @@ function openJdkSpec(jdkVersion: JdkVersion): PluginToolSpec {
{
platform: "linux",
architecture: "arm64",
url: jdkVersion.baseUrl + jdkVersion.linux_arm64.filename,
url: getUrl(jdkVersion, jdkVersion.linux_arm64),
sha256: jdkVersion.linux_arm64.sha256,
extract: {
format: "tar",
Expand All @@ -211,7 +217,7 @@ function openJdkSpec(jdkVersion: JdkVersion): PluginToolSpec {
{
platform: "windows",
architecture: "amd64",
url: jdkVersion.baseUrl + jdkVersion.windows.filename,
url: getUrl(jdkVersion, jdkVersion.windows),
sha256: jdkVersion.windows.sha256,
extract: {
format: "zip",
Expand Down

0 comments on commit a333a9e

Please sign in to comment.