diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c41463e..fb71caa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - scala: [2.12, 2.13, 3] + scala: [2.13, 3] java: [temurin@8] runs-on: ${{ matrix.os }} timeout-minutes: 60 @@ -67,11 +67,11 @@ jobs: - name: Make target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - run: mkdir -p target project/target + run: mkdir -p target jvm/target js/target project/target - name: Compress target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) - run: tar cf targets.tar target project/target + run: tar cf targets.tar target jvm/target js/target project/target - name: Upload target directories if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v')) @@ -108,16 +108,6 @@ jobs: if: matrix.java == 'temurin@8' && steps.setup-java-temurin-8.outputs.cache-hit == 'false' run: sbt +update - - name: Download target directories (2.12) - uses: actions/download-artifact@v4 - with: - name: target-${{ matrix.os }}-${{ matrix.java }}-2.12 - - - name: Inflate target directories (2.12) - run: | - tar xf targets.tar - rm targets.tar - - name: Download target directories (2.13) uses: actions/download-artifact@v4 with: diff --git a/.mergify.yml b/.mergify.yml index c10a885..53e0fbd 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -12,7 +12,6 @@ pull_request_rules: - or: - body~=labels:.*early-semver-patch - body~=labels:.*early-semver-minor - - status-success=Build and Test (ubuntu-latest, 2.12, temurin@8) - status-success=Build and Test (ubuntu-latest, 2.13, temurin@8) - status-success=Build and Test (ubuntu-latest, 3, temurin@8) actions: diff --git a/build.sbt b/build.sbt index c25535e..fb43586 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,8 @@ ThisBuild / organization := "com.dwolla" ThisBuild / homepage := Option(url("https://github.com/Dwolla/natchez-smithy4s")) ThisBuild / tlBaseVersion := "0.1" -ThisBuild / crossScalaVersions := Seq("2.12.19", "2.13.14", "3.3.3") -ThisBuild / githubWorkflowScalaVersions := Seq("2.12", "2.13", "3") +ThisBuild / crossScalaVersions := Seq("2.13.14", "3.3.3") +ThisBuild / githubWorkflowScalaVersions := Seq("2.13", "3") ThisBuild / tlJdkRelease := Option(8) ThisBuild / tlFatalWarnings := githubIsWorkflowBuild.value ThisBuild / startYear := Option(2024) @@ -22,17 +22,23 @@ ThisBuild / mergifyStewardConfig ~= { _.map { .withMergeMinors(true) }} -lazy val `natchez-smithy4s` = project - .in(file(".")) - .enablePlugins(Smithy4sCodegenPlugin) +lazy val `natchez-smithy4s` = crossProject(JVMPlatform, JSPlatform) + .crossType(CrossType.Pure) + .in(file("core")) .settings( + Compile / smithy4sInputDirs := List( + baseDirectory.value.getParentFile / "src" / "main" / "smithy", + ), libraryDependencies ++= { Seq( - "com.disneystreaming.smithy4s" %% "smithy4s-core" % smithy4sVersion.value, - "com.disneystreaming.smithy4s" %% "smithy4s-http4s" % smithy4sVersion.value, - "com.disneystreaming.smithy4s" %% "smithy4s-cats" % smithy4sVersion.value, - "com.disneystreaming.smithy4s" %% "smithy4s-json" % smithy4sVersion.value, - "org.tpolecat" %% "natchez-core" % "0.3.5", + "com.disneystreaming.smithy4s" %%% "smithy4s-core" % smithy4sVersion.value, + "com.disneystreaming.smithy4s" %%% "smithy4s-json" % smithy4sVersion.value, + "org.tpolecat" %%% "natchez-core" % "0.3.5", ) }, ) + .enablePlugins(Smithy4sCodegenPlugin) + +lazy val root = tlCrossRootProject + .aggregate(`natchez-smithy4s`) + .enablePlugins(NoPublishPlugin) diff --git a/src/main/scala/com/dwolla/tracing/smithy/SchemaVisitorTraceableValue.scala b/core/src/main/scala/com/dwolla/tracing/smithy/SchemaVisitorTraceableValue.scala similarity index 100% rename from src/main/scala/com/dwolla/tracing/smithy/SchemaVisitorTraceableValue.scala rename to core/src/main/scala/com/dwolla/tracing/smithy/SchemaVisitorTraceableValue.scala diff --git a/src/main/smithy/natchez.smithy b/core/src/main/smithy/natchez.smithy similarity index 100% rename from src/main/smithy/natchez.smithy rename to core/src/main/smithy/natchez.smithy diff --git a/project/plugins.sbt b/project/plugins.sbt index 97128df..050e6c2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,4 +1,6 @@ +addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2") addSbtPlugin("org.typelevel" % "sbt-typelevel-ci-release" % "0.7.1") addSbtPlugin("org.typelevel" % "sbt-typelevel-mergify" % "0.7.1") addSbtPlugin("org.typelevel" % "sbt-typelevel-settings" % "0.7.1") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") addSbtPlugin("com.disneystreaming.smithy4s" % "smithy4s-sbt-codegen" % "0.18.22")