From e48107c71c8319e7c622e38b9fa3c046f92378ce Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Wed, 27 Sep 2023 12:44:08 +0400 Subject: [PATCH 1/6] Fix publishing of codegen and "big data" modules for Scala 2.13 (#2877) --- build.sbt | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/build.sbt b/build.sbt index 8df35756ba..5ad5f77c0d 100644 --- a/build.sbt +++ b/build.sbt @@ -140,24 +140,15 @@ lazy val filteredModules = { println("SBT =:> Invoking Aggregate Project") Seq[sbt.ClasspathDep[sbt.ProjectReference]]() case _ | "all" => - // Workaround for https://github.com/sbt/sbt/issues/3465 - if (isScala213) { - println("SBT =:> Compiling Scala 2.13 Modules") - baseModules ++ dbModules ++ jasyncModules - } else { - println("SBT =:> Compiling All Modules") - allModules - // Note, can't do this because things like inform (i.e. formatting) actually do run for all modules - // throw new IllegalStateException("Tried to build all modules. Not allowed.") - } + println("SBT =:> Compiling All Modules") + allModules } val selectedModules = { val modules = moduleStrings - .map(matchModules(_)) - .map(seq => ListSet(seq: _*)) - .flatMap(elem => elem) + .map(matchModules) + .flatMap(seq => ListSet(seq: _*)) if (isScala213) { println("SBT =:> Compiling 2.13 Modules Only") From 00d89bd3ee3af6284f2787aafe1792d6711569b2 Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Thu, 28 Sep 2023 14:44:06 +0400 Subject: [PATCH 2/6] Fix publishing to Sonatype (#2879) It seems not possible to publish in parallel to Sonatype, one publish process "closing" the ongoing other ones See logs in: - https://github.com/zio/zio-quill/actions/runs/6336694216/job/17211353656 - https://github.com/zio/zio-quill/actions/runs/6336694216/job/17211353055 ```bash 2023-09-28 09:39:19.526Z info [SonatypeClient] Creating a staging repository in profile io.getquill with a description key: [sbt-sonatype] quill 4.7.1 - (SonatypeClient.scala:122) 2023-09-28 09:39:39.873Z info [SonatypeService] Found a previous staging repository [iogetquill-2462] status:open, profile:io.getquill(4b350f33294246) description: [sbt-sonatype] quill 4.7.1 - (SonatypeService.scala:105) 2023-09-28 09:39:39.873Z info [SonatypeClient] Dropping staging repository [iogetquill-2462] status:open, profile:io.getquill(4b350f33294246) description: [sbt-sonatype] quill 4.7.1 - (SonatypeClient.scala:225) ``` --- .github/workflows/ci.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5dc65007e0..b467601943 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,10 +82,6 @@ jobs: if: ${{github.event_name != 'pull_request'}} runs-on: ubuntu-latest needs: build - strategy: - fail-fast: false - matrix: - scala: [ 2.12.x, 2.13.x, 3.3.x ] env: CI_RELEASE: publishSigned # By default, sbt-ci-release uses the `+publishSigned` which is publishing for all the Scala versions configured, which is not what we want CI_SNAPSHOT_RELEASE: publish # By default, sbt-ci-release uses the `+publish` which is publishing for all the Scala versions configured, which is not what we want @@ -97,7 +93,10 @@ jobs: distribution: temurin java-version: '8' check-latest: true - - run: sbt ++${{ matrix.scala }} -Dquill.scala.version=${{ matrix.scala }} ci-release + - run: | + sbt ++2.12.x -Dquill.scala.version=2.12.x ci-release + sbt ++2.13.x -Dquill.scala.version=2.13.x ci-release + sbt ++3.3.x -Dquill.scala.version=3.3.x ci-release env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} PGP_SECRET: ${{ secrets.PGP_SECRET }} From e46edb29b794e19e4f512a2b34d39bfcf5472824 Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Thu, 28 Sep 2023 14:45:15 +0400 Subject: [PATCH 3/6] Publish Doc with Scala 2.13 instead of Scala 2.12 (#2880) * Fix publishing to Sonatype It seems not possible to publish in parallel to Sonatype, one publish process "closing" the ongoing other ones See logs in: - https://github.com/zio/zio-quill/actions/runs/6336694216/job/17211353656 - https://github.com/zio/zio-quill/actions/runs/6336694216/job/17211353055 ```bash 2023-09-28 09:39:19.526Z info [SonatypeClient] Creating a staging repository in profile io.getquill with a description key: [sbt-sonatype] quill 4.7.1 - (SonatypeClient.scala:122) 2023-09-28 09:39:39.873Z info [SonatypeService] Found a previous staging repository [iogetquill-2462] status:open, profile:io.getquill(4b350f33294246) description: [sbt-sonatype] quill 4.7.1 - (SonatypeService.scala:105) 2023-09-28 09:39:39.873Z info [SonatypeClient] Dropping staging repository [iogetquill-2462] status:open, profile:io.getquill(4b350f33294246) description: [sbt-sonatype] quill 4.7.1 - (SonatypeClient.scala:225) ``` * Publish Doc with Scala 2.13 instead of Scala 2.12 * Clean --- build.sbt | 40 ++++++++++++++-------------------------- 1 file changed, 14 insertions(+), 26 deletions(-) diff --git a/build.sbt b/build.sbt index 5ad5f77c0d..db46173b6f 100644 --- a/build.sbt +++ b/build.sbt @@ -72,26 +72,14 @@ lazy val bigdataModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]]( lazy val allModules = baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules ++ docsModules -lazy val scala213Modules = - baseModules ++ dbModules ++ codegenModules ++ Seq[sbt.ClasspathDep[sbt.ProjectReference]]( - `quill-cassandra`, - `quill-cassandra-alpakka`, - `quill-cassandra-monix`, - `quill-cassandra-zio`, - `quill-orientdb`, - `quill-jasync`, - `quill-jasync-postgres`, - `quill-jasync-mysql`, - `quill-jasync-zio`, - `quill-jasync-zio-postgres`, - `quill-spark` - ) +lazy val scala212Modules = + baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules lazy val scala3Modules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](`quill-engine`, `quill-util`) -def isScala213 = { +def isScala212 = { val scalaVersion = sys.props.get("quill.scala.version") - scalaVersion.map(_.startsWith("2.13")).getOrElse(false) + scalaVersion.map(_.startsWith("2.12")).getOrElse(false) } def isScala3 = { @@ -150,9 +138,9 @@ lazy val filteredModules = { .map(matchModules) .flatMap(seq => ListSet(seq: _*)) - if (isScala213) { - println("SBT =:> Compiling 2.13 Modules Only") - modules.filter(scala213Modules.contains(_)) + if (isScala212) { + println("SBT =:> Compiling 2.12 Modules Only") + modules.filter(scala212Modules.contains(_)) } else if (isScala3) { println("SBT =:> Compiling 3 Modules Only") modules.filter(scala3Modules.contains(_)) @@ -713,13 +701,13 @@ lazy val docs = project projectName := "ZIO Quill", mainModuleName := (`quill-core` / moduleName).value, // With Scala 2.12, these projects doc isn't compiling. - ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects( - `quill-engine`, - `quill-core`, - `quill-cassandra-monix`, - `quill-orientdb`, - `quill-doobie` - ), + //ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects( + // `quill-engine`, + // `quill-core`, + // `quill-cassandra-monix`, + // `quill-orientdb`, + // `quill-doobie` + //), projectStage := ProjectStage.ProductionReady, checkArtifactBuildProcessWorkflowStep := None, docsPublishBranch := "master", From a78efd825380cee0f8fb61cdbb05723ef79030ed Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Thu, 28 Sep 2023 16:16:48 +0400 Subject: [PATCH 4/6] The scaladoc apparently requires Scala 2.12 (#2882) See: https://github.com/zio/zio-quill/actions/runs/6337872463/job/17215027348#logs Error: ```scala [info] Main Scala API documentation to /home/runner/work/zio-quill/zio-quill/zio-quill-docs/target/scala-2.12/unidoc... java.io.IOException: Scala signature package has wrong version expected: 5.0 found: 5.2 in package.class ``` --- .github/workflows/ci.yml | 6 +++--- build.sbt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b467601943..c0ce1bae3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,9 +94,9 @@ jobs: java-version: '8' check-latest: true - run: | - sbt ++2.12.x -Dquill.scala.version=2.12.x ci-release - sbt ++2.13.x -Dquill.scala.version=2.13.x ci-release - sbt ++3.3.x -Dquill.scala.version=3.3.x ci-release + sbt ++2.12.x -Dquill.scala.version=2.12.x -Dquill.macro.log=false ci-release + sbt ++2.13.x -Dquill.scala.version=2.13.x -Dquill.macro.log=false ci-release + sbt ++3.3.x -Dquill.scala.version=3.3.x -Dquill.macro.log=false ci-release env: PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} PGP_SECRET: ${{ secrets.PGP_SECRET }} diff --git a/build.sbt b/build.sbt index db46173b6f..b7bfe34b81 100644 --- a/build.sbt +++ b/build.sbt @@ -70,10 +70,10 @@ lazy val bigdataModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]]( ) lazy val allModules = - baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules ++ docsModules + baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules lazy val scala212Modules = - baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules + baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules ++ docsModules lazy val scala3Modules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](`quill-engine`, `quill-util`) From 450afe8998f19b9d8389e40780be59422343df92 Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Thu, 28 Sep 2023 16:41:10 +0400 Subject: [PATCH 5/6] The scaladoc apparently requires Scala 2.12, BIS (#2883) See: https://github.com/zio/zio-quill/actions/runs/6337872463/job/17215027348#logs Error: ```scala [info] Main Scala API documentation to /home/runner/work/zio-quill/zio-quill/zio-quill-docs/target/scala-2.12/unidoc... java.io.IOException: Scala signature package has wrong version expected: 5.0 found: 5.2 in package.class ``` --- build.sbt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build.sbt b/build.sbt index b7bfe34b81..ef922dabac 100644 --- a/build.sbt +++ b/build.sbt @@ -701,13 +701,13 @@ lazy val docs = project projectName := "ZIO Quill", mainModuleName := (`quill-core` / moduleName).value, // With Scala 2.12, these projects doc isn't compiling. - //ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects( - // `quill-engine`, - // `quill-core`, - // `quill-cassandra-monix`, - // `quill-orientdb`, - // `quill-doobie` - //), + ScalaUnidoc / unidoc / unidocProjectFilter := inAnyProject -- inProjects( + `quill-engine`, + `quill-core`, + `quill-cassandra-monix`, + `quill-orientdb`, + `quill-doobie` + ), projectStage := ProjectStage.ProductionReady, checkArtifactBuildProcessWorkflowStep := None, docsPublishBranch := "master", From a6a17ae53a754c1c80c5ff989c023bdde29159a7 Mon Sep 17 00:00:00 2001 From: Jules Ivanic Date: Thu, 28 Sep 2023 19:28:56 +0400 Subject: [PATCH 6/6] Fix publishing of docs (#2884) --- build.sbt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build.sbt b/build.sbt index ef922dabac..f695def6a1 100644 --- a/build.sbt +++ b/build.sbt @@ -70,16 +70,16 @@ lazy val bigdataModules = Seq[sbt.ClasspathDep[sbt.ProjectReference]]( ) lazy val allModules = - baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules - -lazy val scala212Modules = baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules ++ docsModules +lazy val scala213Modules = + baseModules ++ dbModules ++ jasyncModules ++ codegenModules ++ bigdataModules + lazy val scala3Modules = Seq[sbt.ClasspathDep[sbt.ProjectReference]](`quill-engine`, `quill-util`) -def isScala212 = { +def isScala213 = { val scalaVersion = sys.props.get("quill.scala.version") - scalaVersion.map(_.startsWith("2.12")).getOrElse(false) + scalaVersion.map(_.startsWith("2.13")).getOrElse(false) } def isScala3 = { @@ -138,9 +138,9 @@ lazy val filteredModules = { .map(matchModules) .flatMap(seq => ListSet(seq: _*)) - if (isScala212) { - println("SBT =:> Compiling 2.12 Modules Only") - modules.filter(scala212Modules.contains(_)) + if (isScala213) { + println("SBT =:> Compiling 2.13 Modules Only") + modules.filter(scala213Modules.contains(_)) } else if (isScala3) { println("SBT =:> Compiling 3 Modules Only") modules.filter(scala3Modules.contains(_))