Skip to content

Commit

Permalink
Fix layout of released SDK archives, restore intermiediete top-level …
Browse files Browse the repository at this point in the history
…directory (#22199)

Fixes #22194 

Restores top-level directory `scala3-${version}` that is present in
artifacts published before Scala 3.6, removed during hotfix 3.6.1
release.
We now follow the [Well formed SDK archives
layout](https://github.com/sdkman/sdkman-cli/wiki/Well-formed-SDK-archives).
Removing the top-level directory even though at first glance looked like
an improvement was in fact introducing problems to multiple package
managers and build tools.
  • Loading branch information
WojciechMazur authored Dec 12, 2024
1 parent d685c0b commit 5b3d82a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -801,19 +801,13 @@ 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
for file in "${artifactName}.zip" "${artifactName}.tar.gz"; do
mv ${distDir}/target/universal/$file $file
sha256sum "${file}" > "${file}.sha256"
done
}
Expand Down
9 changes: 8 additions & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit 5b3d82a

Please sign in to comment.