From 204ea6e43b10bf67579cf0f27ac33098316b3111 Mon Sep 17 00:00:00 2001 From: Ed Merks Date: Wed, 3 Sep 2025 14:04:50 +0200 Subject: [PATCH] Automate updating promote-a-build.sh - It should include a proper `` that can be computed and added automatically at the start of each cycle. - Also update upload-to-staging.sh with the most recent +1s. https://github.com/eclipse-packaging/packages/issues/353 --- .../org/eclipse/epp/releng/updater/Updater.java | 14 ++++++++++++++ .../tools/promote-a-build.sh | 1 + .../tools/upload-to-staging.sh | 8 ++++---- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/releng/org.eclipse.epp.config/org.eclipse.epp.releng.updater/src/org/eclipse/epp/releng/updater/Updater.java b/releng/org.eclipse.epp.config/org.eclipse.epp.releng.updater/src/org/eclipse/epp/releng/updater/Updater.java index 5f5dae09..cb05769e 100644 --- a/releng/org.eclipse.epp.config/org.eclipse.epp.releng.updater/src/org/eclipse/epp/releng/updater/Updater.java +++ b/releng/org.eclipse.epp.config/org.eclipse.epp.releng.updater/src/org/eclipse/epp/releng/updater/Updater.java @@ -220,6 +220,20 @@ private void visit(Path file) throws IOException { + "\"\\s+name=\"" + SIMREL_VERSION_MATCHER + "\"", SIMREL_VERSION, SIMREL_VERSION); } else if (fileName.equals("MANIFEST.MF")) { apply(file, "Bundle-Version: " + PLATFORM_VERSION_MATCHER + "\\.0\\.qualifier", PLATFORM_VERSION); + } else if (fileName.equals("promote-a-build.sh")) { + var pattern = Pattern.compile("(?20[2-9][0-9]-(?:03|06|09|12))/R(?\r?\n)EOM"); + var content = getContent(file); + var matcher = pattern.matcher(content); + if (!matcher.find()) { + throw new IllegalStateException("Expecting a proper match in " + relativePathName); + } + var expectedPastVersion = getSimRelVersion(PLATFORM_VERSION, -2); + if (!expectedPastVersion.equals(matcher.group("version"))) { + var modifiedContent = content.substring(0, matcher.end("nl")) // + + "" + expectedPastVersion + "/R" + matcher.group("nl")// + + content.substring(matcher.end("nl")); + contents.put(file, modifiedContent); + } } else if (relativePathName.equals("RELEASING.md")) { // TODO } diff --git a/releng/org.eclipse.epp.config/tools/promote-a-build.sh b/releng/org.eclipse.epp.config/tools/promote-a-build.sh index 1e198a22..ac5e562e 100755 --- a/releng/org.eclipse.epp.config/tools/promote-a-build.sh +++ b/releng/org.eclipse.epp.config/tools/promote-a-build.sh @@ -90,6 +90,7 @@ cat > release.xml <2024-06/R 2024-09/R 2024-12/R +2025-03/R EOM if [ "$RELEASE_MILESTONE" != "R" ]; then cat >> release.xml <