From 7696ad1416dae88ca413ffdcc8fb3183bf902140 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 18 Jul 2024 23:58:36 +0000 Subject: [PATCH] Ensure macos using gsed to avoid sha512 value substitution issues (#456) Signed-off-by: Peter Zhu (cherry picked from commit 96cf7bf8d14c9da4c0c52851a4547cc289a6ef65) Signed-off-by: github-actions[bot] --- build.gradle | 2 +- vars/uploadMinSnapshotsToS3.groovy | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 326e07f4..bad04427 100644 --- a/build.gradle +++ b/build.gradle @@ -127,7 +127,7 @@ jacocoTestReport { } } -String version = '6.6.0' +String version = '6.6.1' task updateVersion { doLast { diff --git a/vars/uploadMinSnapshotsToS3.groovy b/vars/uploadMinSnapshotsToS3.groovy index 890e4f6a..166239cb 100644 --- a/vars/uploadMinSnapshotsToS3.groovy +++ b/vars/uploadMinSnapshotsToS3.groovy @@ -52,11 +52,16 @@ void call(Map args = [:]) { echo("Start copying files: version-${version} architecture-${architecture} platform-${platform} buildid-${id} distribution-${distribution} extension-${extension}") + String sedCmd = "sed" + if (platform == "darwin") { + sedCmd = "gsed" + } + sh """ cp -v ${srcDir}/${baseName}.${extension} ${srcDir}/${baseName}-latest.${extension} cp -v ${srcDir}/${baseName}.${extension}.sha512 ${srcDir}/${baseName}-latest.${extension}.sha512 cp -v ${srcDir}/../manifest.yml ${srcDir}/${baseName}-latest.${extension}.build-manifest.yml - sed -i "s/.${extension}/-latest.${extension}/g" ${srcDir}/${baseName}-latest.${extension}.sha512 + ${sedCmd} -i "s/.${extension}/-latest.${extension}/g" ${srcDir}/${baseName}-latest.${extension}.sha512 """ withCredentials([ string(credentialsId: 'jenkins-artifact-promotion-role', variable: 'ARTIFACT_PROMOTION_ROLE_NAME'),