diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6899916c..5fd5bc8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,7 @@ jobs: - run: sbt ++${{ matrix.scala }} test mimaReportBinaryIssues - name: Compress target directories - run: tar cf targets.tar modules/sttp/target modules/http4s/target modules/scalacache/target modules/doobie/target modules/log4cats/target modules/akka-http/target modules/circe/target modules/http4s-client/target modules/redis/target modules/core/target target project/target + run: tar cf targets.tar modules/sttp/target modules/http4s/target modules/scalacache/target modules/doobie/target modules/log4cats/target modules/akka-http/target microsite/target modules/circe/target modules/http4s-client/target modules/redis/target modules/core/target target project/target - name: Upload target directories uses: actions/upload-artifact@v2 @@ -122,4 +122,46 @@ jobs: - uses: olafurpg/setup-gpg@v3 - - run: sbt ++${{ matrix.scala }} ci-release \ No newline at end of file + - run: sbt ++${{ matrix.scala }} ci-release + + microsite: + name: Microsite + strategy: + matrix: + os: [ubuntu-latest] + scala: [2.12.13] + java: [graalvm-ce-java11@21.0.0] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout current branch (full) + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Setup Java and Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: ${{ matrix.java }} + + - name: Cache sbt + uses: actions/cache@v2 + with: + path: | + ~/.sbt + ~/.ivy2/cache + ~/.coursier/cache/v1 + ~/.cache/coursier/v1 + ~/AppData/Local/Coursier/Cache/v1 + ~/Library/Caches/Coursier/v1 + key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + + - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7 + + - name: Setup Jekyll + run: gem install jekyll -v 4.0.0 + + - name: Build the microsite + run: sbt ++${{ matrix.scala }} microsite/makeMicrosite \ No newline at end of file diff --git a/build.sbt b/build.sbt index 82df5984..9ee57484 100644 --- a/build.sbt +++ b/build.sbt @@ -40,6 +40,24 @@ ThisBuild / githubWorkflowEnv ++= List( "SONATYPE_USERNAME" ).map(envKey => envKey -> s"$${{ secrets.$envKey }}").toMap +ThisBuild / githubWorkflowAddedJobs ++= Seq( + WorkflowJob( + "microsite", + "Microsite", + githubWorkflowJobSetup.value.toList ::: List( + WorkflowStep.Use( + UseRef.Public("ruby", "setup-ruby", "v1"), + params = Map("ruby-version" -> "2.7"), + name = Some("Setup Ruby") + ), + WorkflowStep.Run(List("gem install jekyll -v 4.0.0"), name = Some("Setup Jekyll")), + WorkflowStep.Sbt(List("microsite/makeMicrosite"), name = Some("Build the microsite")) + ), + javas = List(GraalVM11), + scalas = List(Scala_212) + ) +) + inThisBuild( List( organization := "com.kubukoz", @@ -173,10 +191,8 @@ def enumerateAnd(values: List[String]): String = { } else values.mkString } -/* val microsite = project .settings( - scalaVersion := Scala_212, micrositeName := "sup", micrositeDescription := "Functional healthchecks in Scala", micrositeDocumentationUrl := "/guide", @@ -195,6 +211,7 @@ val microsite = project "de.heikoseeberger" %% "akka-http-circe" % "1.29.1" ), skip in publish := true, + mimaPreviousArtifacts := Set.empty, buildInfoPackage := "sup.buildinfo", micrositeAnalyticsToken := "UA-55943015-9", buildInfoKeys := Seq[BuildInfoKey](lastStableVersion), @@ -206,13 +223,14 @@ val microsite = project "SCALA_VERSIONS" -> enumerateAnd((crossScalaVersions in core).value.toList.map(dropMinor)) ) ) + .enablePlugins(MdocPlugin) .enablePlugins(MicrositesPlugin) .enablePlugins(BuildInfoPlugin) .dependsOn(allModules.map(x => x: ClasspathDep[ProjectReference]): _*) - */ + val sup = project .in(file(".")) .settings(commonSettings) .settings(skip in publish := true, crossScalaVersions := List(), mimaPreviousArtifacts := Set.empty) - .aggregate((/* microsite :: */ allModules).map(x => x: ProjectReference): _*) + .aggregate((microsite :: allModules).map(x => x: ProjectReference): _*) diff --git a/project/plugins.sbt b/project/plugins.sbt index 2711af21..1cbd20b2 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,6 @@ addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7") addSbtPlugin("com.47deg" % "sbt-microsites" % "1.3.0") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.2.19") addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.10.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.16")