From 269a59d4bf07a495db29efa4689d62e3727a703c Mon Sep 17 00:00:00 2001 From: George Gastaldi Date: Thu, 30 Nov 2023 18:35:41 -0300 Subject: [PATCH] Bump build and release script to JDK 17 --- patches/BumpToJDK17.java | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/patches/BumpToJDK17.java b/patches/BumpToJDK17.java index 93ca59b..f6b4c5c 100755 --- a/patches/BumpToJDK17.java +++ b/patches/BumpToJDK17.java @@ -9,10 +9,29 @@ public class BumpToJDK17 { public static void main(String... args) throws Exception { - Path workflowFile = Path.of(".github/workflows/quarkus-snapshot.yaml"); - if (Files.exists(workflowFile)) { - Files.writeString(workflowFile, - Files.readString(workflowFile).replace("JAVA_VERSION: 11", "JAVA_VERSION: 17")); + // Update snapshot workflow + { + Path workflowFile = Path.of(".github/workflows/quarkus-snapshot.yaml"); + if (Files.exists(workflowFile)) { + Files.writeString(workflowFile, + Files.readString(workflowFile).replace("JAVA_VERSION: 11", "JAVA_VERSION: 17")); + } + } + // Update release workflow + { + Path workflowFile = Path.of(".github/workflows/release.yml"); + if (Files.exists(workflowFile)) { + String contents = Files.readString(workflowFile); + Files.writeString(workflowFile, contents.replace("JDK 11", "JDK 17").replace("java-version: 11", "java-version: 17")); + } + } + // Update build.yaml as well + { + Path workflowFile = Path.of(".github/workflows/build.yml"); + if (Files.exists(workflowFile)) { + String contents = Files.readString(workflowFile); + Files.writeString(workflowFile, contents.replace("JDK 11", "JDK 17").replace("java-version: 11", "java-version: 17")); + } } } }