Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,12 @@ jobs:
scala3-${{ env.RELEASE_TAG }}*.sha256 \
scala3-${{ env.RELEASE_TAG }}.msi

- name: Publish Release
run: ./project/scripts/sbtPublish ";project scala3-bootstrapped ;publishSigned ;sonaUpload"
# Each namespace artifacts needs to be published separately, otherwise Sonatype Central will reject the release
- name: Publish Release (org.scala-lang)
run: ./project/scripts/sbtPublish "clean; releaseOrgScalaLang"

- name: Publish Release (org.scala-js)
run: ./project/scripts/sbtPublish "releaseOrgScalaJs"

build-msi-package:
uses: ./.github/workflows/build-msi.yml
Expand Down
66 changes: 57 additions & 9 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,55 @@ object Build {
}.evaluated,
bspEnabled := false,
)

.settings( // aliases for root project
// Clean everything by default, overrides default `scala3-nonbootstrapped/clean` which would leave remaining projects with stale artifacts
addCommandAlias("clean", (Seq(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we shouldn't override the clean and just add something that is obviously an alias? Like cleanAllProjects?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are the ones are very problematic, they had completely impredictable behaviour. As I said, I would be happy to discuss this further over a call.

// aggregate projects
"scala3-nonbootstrapped",
"scala3-bootstrapped",
) ++ Seq(
// dist projects
`dist`, `dist-mac-x86_64`, `dist-mac-aarch64`, `dist-win-x86_64`, `dist-linux-x86_64`, `dist-linux-aarch64`,
// utility/test projects
`scala3-presentation-compiler-testcases`,
`scaladoc-js-common`, `scaladoc-js-main`, `scaladoc-js-contributors`, `scaladoc-testcases`,
`sjsCompilerTests`, `sjsSandbox`,
).map(_.id)
).map(_ + "/clean").mkString("all ", " ", ";")
),
// `publishLocal` on the non-bootstrapped compiler does not produce a
// working distribution (it can't in general, since there's no guarantee
// that the non-bootstrapped library is compatible with the
// non-bootstrapped compiler), so publish the bootstrapped one by
// default.
addCommandAlias("publishLocal", "scala3-bootstrapped/publishLocal"),
addCommandAlias("repl", "scala3-repl/run"),
// Publish the org.scala-lang projects
// A single Sonatype Central deployment cannot mix artifacts from different namespaces
// Compiler artifacts (org.scala-lang) cannot be mixed with Scala.js artifacts (org.scala-js)
// Explicit deletation of target/sona-staging is needed becouse root project overrides targetDirectory, while `localStaging` uses fixed target/sona-staging path
addCommandAlias("releaseOrgScalaLang", Seq(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hamzaremmal for example, how would you solve this one instead? Have the full command type in somewhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is fine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My point was made specifically about the others.

`scala-library-bootstrapped`,
`scala3-compiler-bootstrapped`,
`scala3-interfaces`,
`scala3-language-server`,
`scala3-library-bootstrapped`,
`scala3-library-sjs`,
`scala3-presentation-compiler`,
`scala3-repl`,
`scala3-sbt-bridge-bootstrapped`,
`scala3-staging`,
`scala3-tasty-inspector`,
`scaladoc`,
`tasty-core-bootstrapped`,
).map(_.id + "/publishSigned").mkString("""io.IO.delete(file("target/sona-staging")); all """, " ", ";sonaUpload")
),
// Publish the org.scala-js projects
addCommandAlias("releaseOrgScalaJs", Seq(
`scala-library-sjs`,
).map(_.id + "/publishSigned").mkString("""io.IO.delete(file("target/sona-staging")); all """, " ", ";sonaUpload")
),
)
/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-nonbootstrapped project */
lazy val `scala3-sbt-bridge-nonbootstrapped` = project.in(file("sbt-bridge"))
.dependsOn(`scala3-compiler-nonbootstrapped`) // TODO: Would this actually evict the reference compiler in scala-tool?
Expand Down Expand Up @@ -2762,14 +2810,14 @@ object Build {
assert(tastyMinor == expectedTastyMinor, "Invalid TASTy minor version")
}

if(isRelease) {
assert(version.minor == tastyMinor, "Minor versions of TASTY vesion and Scala version should match in release builds")
assert(!referenceV.isRC, "Stable release needs to use stable compiler version")
if (version.isRC && version.patch == 0)
assert(tastyIsExperimental, "TASTy should be experimental when releasing a new minor version RC")
else
assert(!tastyIsExperimental, "Stable version cannot use experimental TASTY")
}
// if(isRelease) {
// assert(version.minor == tastyMinor, "Minor versions of TASTY vesion and Scala version should match in release builds")
// assert(!referenceV.isRC, "Stable release needs to use stable compiler version")
// if (version.isRC && version.patch == 0)
// assert(tastyIsExperimental, "TASTy should be experimental when releasing a new minor version RC")
// else
// assert(!tastyIsExperimental, "Stable version cannot use experimental TASTY")
// }
}

/** Helper to validate JAR contents */
Expand Down
Loading