From f44e12d5444e04edc79bf96fe10c1e315a1e1b8b Mon Sep 17 00:00:00 2001 From: Wojciech Mazur Date: Thu, 12 Dec 2024 11:37:59 +0100 Subject: [PATCH] Fix layout of released SDK archives, restore top-level directory `scala3-{{ scala-version }}` --- .github/workflows/ci.yaml | 7 ++----- project/Build.scala | 9 ++++++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a2006e16c7e8..dc742f07a84f 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -801,19 +801,16 @@ jobs: distDir="$3" # Build binaries - ./project/scripts/sbt "${sbtProject}/Universal/stage" + ./project/scripts/sbt "all ${sbtProject}/Universal/packageBin ${sbtProject}/Universal/packageZipTarball" outputPath="${distDir}/target/universal/stage" artifactName="scala3-${{ env.RELEASE_TAG }}${distroSuffix}" zipArchive="${artifactName}.zip" tarGzArchive="${artifactName}.tar.gz" - cwd=$(pwd) - (cd $outputPath && zip -r ${zipArchive} . && mv ${zipArchive} "${cwd}/") - tar -czf ${tarGzArchive} -C "$outputPath" . - # Caluclate SHA for each of archive files for file in "${zipArchive}" "${tarGzArchive}"; do + mv $outputPath/$file $file sha256sum "${file}" > "${file}.sha256" done } diff --git a/project/Build.scala b/project/Build.scala index db3f149cbab6..5aec4a4231a6 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -2257,7 +2257,14 @@ object Build { // ======== Universal / stage := (Universal / stage).dependsOn(republish).value, Universal / packageBin := (Universal / packageBin).dependsOn(republish).value, - Universal / packageZipTarball := (Universal / packageZipTarball).dependsOn(republish).value, + Universal / packageZipTarball := (Universal / packageZipTarball).dependsOn(republish) + .map { archiveFile => + // Rename .tgz to .tar.gz for consistency with previous versions + val renamedFile = archiveFile.getParentFile() / archiveFile.getName.replaceAll("\\.tgz$", ".tar.gz") + IO.move(archiveFile, renamedFile) + renamedFile + } + .value, // ======== Universal / mappings ++= directory(dist.base / "bin"), Universal / mappings ++= directory(republishRepo.value / "maven2"),