Skip to content

Commit 506512f

Browse files
authored
chore: release artifacts of the new build to the new repository (#23761)
Add workflow to release the artifacts of the new nightly to the new repository. This is still not fully complete, but it does what we want it to do at the moment. [skip ci]
2 parents e9cb3bb + dc37512 commit 506512f

File tree

3 files changed

+71
-73
lines changed

3 files changed

+71
-73
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release Artifacts to Maven
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
environment:
7+
required: true
8+
type: string
9+
10+
jobs:
11+
release-maven-artifacts:
12+
runs-on: ubuntu-latest
13+
environment: ${{ inputs.environment }}
14+
steps:
15+
- uses: actions/checkout@v5
16+
- uses: actions/setup-java@v4
17+
with:
18+
distribution: 'adopt'
19+
java-version: 17
20+
cache: 'sbt'
21+
- uses: sbt/setup-sbt@v1
22+
- name: Publish Artifacts to the Maven Repository
23+
run : sbt scala3-bootstrapped-new/publish

.github/workflows/release-nightly.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Nightly Release of Scala 3
2+
run-name: Nightly Release of Scala 3 (${{ github.sha }})
3+
4+
on:
5+
workflow_dispatch:
6+
schedule:
7+
- cron: '0 3 * * *' # Every day at 3 AM
8+
9+
jobs:
10+
11+
## TODO: Add the compilation pipeline here
12+
13+
## TODO: Add the test pipeline here
14+
15+
release-maven-artifacts:
16+
# TODO: Add a dependency to the test ad compilation pipeline before releasing
17+
uses: ./.github/workflows/release-maven-artifacts.yml
18+
with:
19+
environment: release-nightly

project/Build.scala

Lines changed: 29 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,7 @@ object Build {
14711471
/* Configuration of the org.scala-lang:scala3-sbt-bridge:*.**.**-bootstrapped project */
14721472
lazy val `scala3-sbt-bridge-bootstrapped` = project.in(file("sbt-bridge"))
14731473
.dependsOn(`scala3-compiler-bootstrapped-new`) // TODO: Would this actually evict the reference compiler in scala-tool?
1474+
.settings(publishSettings)
14741475
.settings(
14751476
name := "scala3-sbt-bridge-bootstrapped",
14761477
moduleName := "scala3-sbt-bridge",
@@ -1542,6 +1543,7 @@ object Build {
15421543
// when compiling a project that depends on scala3-staging (see sbt-test/sbt-dotty/quoted-example-project),
15431544
// but we always need it to be present on the JVM classpath at runtime.
15441545
.dependsOn(`scala3-compiler-bootstrapped-new` % "provided; compile->runtime; test->test")
1546+
.settings(publishSettings)
15451547
.settings(
15461548
name := "scala3-staging",
15471549
moduleName := "scala3-staging",
@@ -1599,6 +1601,7 @@ object Build {
15991601
// when compiling a project that depends on scala3-tasty-inspector (see sbt-test/sbt-dotty/tasty-inspector-example-project),
16001602
// but we always need it to be present on the JVM classpath at runtime.
16011603
.dependsOn(`scala3-compiler-bootstrapped-new` % "provided; compile->runtime; test->test")
1604+
.settings(publishSettings)
16021605
.settings(
16031606
name := "scala3-tasty-inspector",
16041607
moduleName := "scala3-tasty-inspector",
@@ -1737,6 +1740,7 @@ object Build {
17371740
/* Configuration of the org.scala-lang:scala-library:*.**.**-bootstrapped project */
17381741
lazy val `scala-library-bootstrapped` = project.in(file("library"))
17391742
.enablePlugins(ScalaLibraryPlugin)
1743+
.settings(publishSettings)
17401744
.settings(
17411745
name := "scala-library-bootstrapped",
17421746
moduleName := "scala-library",
@@ -1809,6 +1813,7 @@ object Build {
18091813
/* Configuration of the org.scala-lang:scala3-library_3:*.**.**-bootstrapped project */
18101814
lazy val `scala3-library-bootstrapped-new` = project.in(file("library"))
18111815
.dependsOn(`scala-library-bootstrapped`)
1816+
.settings(publishSettings)
18121817
.settings(
18131818
name := "scala3-library-bootstrapped",
18141819
moduleName := "scala3-library",
@@ -1851,6 +1856,7 @@ object Build {
18511856
// We add a dependency to the JVM library to have the classfile available
18521857
// (as they are not part of this artifact)
18531858
.dependsOn(`scala3-library-bootstrapped-new`)
1859+
.settings(publishSettings)
18541860
.settings(
18551861
name := "scala-library-sjs",
18561862
organization := "org.scala-js",
@@ -1961,6 +1967,7 @@ object Build {
19611967
/* Configuration of the org.scala-lang:scala3-library_sjs1_3:*.**.**-bootstrapped project */
19621968
lazy val `scala3-library-sjs` = project.in(file("library-js"))
19631969
.dependsOn(`scala-library-sjs`)
1970+
.settings(publishSettings)
19641971
.settings(
19651972
name := "scala3-library-sjs",
19661973
moduleName := "scala3-library_sjs1",
@@ -2064,6 +2071,7 @@ object Build {
20642071
/* Configuration of the org.scala-lang:tasty-core_3:*.**.**-bootstrapped project */
20652072
lazy val `tasty-core-bootstrapped-new` = project.in(file("tasty"))
20662073
.dependsOn(`scala3-library-bootstrapped-new`)
2074+
.settings(publishSettings)
20672075
.settings(
20682076
name := "tasty-core-bootstrapped",
20692077
moduleName := "tasty-core",
@@ -2256,6 +2264,7 @@ object Build {
22562264
/* Configuration of the org.scala-lang:scala3-compiler_3:*.**.**-bootstrapped project */
22572265
lazy val `scala3-compiler-bootstrapped-new` = project.in(file("compiler"))
22582266
.dependsOn(`scala3-interfaces`, `tasty-core-bootstrapped-new`, `scala3-library-bootstrapped-new`)
2267+
.settings(publishSettings)
22592268
.settings(
22602269
name := "scala3-compiler-bootstrapped",
22612270
moduleName := "scala3-compiler",
@@ -2390,6 +2399,7 @@ object Build {
23902399
/* Configuration of the org.scala-lang:scaladoc_3:*.**.**-bootstrapped project */
23912400
lazy val `scaladoc-new` = project.in(file("scaladoc"))
23922401
.dependsOn(`scala3-compiler-bootstrapped-new`, `scala3-tasty-inspector-new`)
2402+
.settings(publishSettings)
23932403
.settings(
23942404
name := "scaladoc",
23952405
moduleName := "scaladoc",
@@ -3527,10 +3537,24 @@ object Build {
35273537
publishMavenStyle := true,
35283538
isSnapshot := version.value.contains("SNAPSHOT"),
35293539
publishTo := {
3530-
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
3531-
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
3532-
else localStaging.value
3540+
if (sys.env.get("NEWNIGHTLY").contains("yes")) {
3541+
Some(sys.env("MAVEN_REPOSITORY_REALM") at sys.env("MAVEN_REPOSITORY_URL"))
3542+
} else if (isSnapshot.value) {
3543+
Some("central-snapshots" at "https://central.sonatype.com/repository/maven-snapshots/")
3544+
} else
3545+
localStaging.value
35333546
},
3547+
credentials ++= (
3548+
if (sys.env.get("NEWNIGHTLY").contains("yes")) {
3549+
for {
3550+
username <- sys.env.get("MAVEN_REPOSITORY_USER")
3551+
token <- sys.env.get("MAVEN_REPOSITORY_TOKEN")
3552+
} yield Credentials(sys.env("MAVEN_REPOSITORY_REALM"), sys.env("MAVEN_REPOSITORY_HOST"), username, token)
3553+
}
3554+
else
3555+
// The old build credentials are configured differently
3556+
None
3557+
).toList,
35343558
publishConfiguration ~= (_.withOverwrite(true)),
35353559
publishLocalConfiguration ~= (_.withOverwrite(true)),
35363560
projectID ~= {id =>
@@ -3539,76 +3563,8 @@ object Build {
35393563
},
35403564
Test / publishArtifact := false,
35413565
homepage := Some(url(dottyGithubUrl)),
3542-
licenses += (("Apache-2.0",
3543-
url("https://www.apache.org/licenses/LICENSE-2.0"))),
3544-
scmInfo := Some(
3545-
ScmInfo(
3546-
url(dottyGithubUrl),
3547-
"scm:git:[email protected]:scala/scala3.git"
3548-
)
3549-
),
3550-
developers := List(
3551-
Developer(
3552-
id = "odersky",
3553-
name = "Martin Odersky",
3554-
email = "[email protected]",
3555-
url = url("https://github.com/odersky")
3556-
),
3557-
Developer(
3558-
id = "DarkDimius",
3559-
name = "Dmitry Petrashko",
3560-
email = "[email protected]",
3561-
url = url("https://d-d.me")
3562-
),
3563-
Developer(
3564-
id = "smarter",
3565-
name = "Guillaume Martres",
3566-
email = "[email protected]",
3567-
url = url("http://guillaume.martres.me")
3568-
),
3569-
Developer(
3570-
id = "felixmulder",
3571-
name = "Felix Mulder",
3572-
email = "[email protected]",
3573-
url = url("http://felixmulder.com")
3574-
),
3575-
Developer(
3576-
id = "liufengyun",
3577-
name = "Liu Fengyun",
3578-
email = "[email protected]",
3579-
url = url("https://fengy.me")
3580-
),
3581-
Developer(
3582-
id = "nicolasstucki",
3583-
name = "Nicolas Stucki",
3584-
email = "[email protected]",
3585-
url = url("https://github.com/nicolasstucki")
3586-
),
3587-
Developer(
3588-
id = "OlivierBlanvillain",
3589-
name = "Olivier Blanvillain",
3590-
email = "[email protected]",
3591-
url = url("https://github.com/OlivierBlanvillain")
3592-
),
3593-
Developer(
3594-
id = "biboudis",
3595-
name = "Aggelos Biboudis",
3596-
email = "[email protected]",
3597-
url = url("http://biboudis.github.io")
3598-
),
3599-
Developer(
3600-
id = "allanrenucci",
3601-
name = "Allan Renucci",
3602-
email = "[email protected]",
3603-
url = url("https://github.com/allanrenucci")
3604-
),
3605-
Developer(
3606-
id = "Duhemm",
3607-
name = "Martin Duhem",
3608-
email = "[email protected]",
3609-
url = url("https://github.com/Duhemm")
3610-
)
3611-
)
3566+
licenses += (("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0"))),
3567+
scmInfo := Some(ScmInfo(url(dottyGithubUrl), "scm:git:[email protected]:scala/scala3.git")),
36123568
)
36133569

36143570
lazy val commonDistSettings = Seq(

0 commit comments

Comments
 (0)