Skip to content
Merged
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
34 changes: 22 additions & 12 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,35 @@ on:

jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v14
- uses: actions/setup-java@v5
with:
java-version: adopt@1.11
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@ce95da69b39609ea153bad087708da5f37366897 # v1, specifically v1.5.10
- name: Run tests with sbt
run: sbt test
run: sbt testFull
- name: Compile docs with mdoc
run: sbt compileDocumentation

publish:
name: Publish release
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
needs: [build]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v14
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@ce95da69b39609ea153bad087708da5f37366897 # v1, specifically v1.5.10
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
Expand All @@ -43,7 +49,7 @@ jobs:
name: Publish docker image
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v'))
needs: [build]
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- name: Login to DockerHub
uses: docker/login-action@v2.2.0
Expand All @@ -53,6 +59,10 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: coursier/cache-action@v6
- uses: olafurpg/setup-scala@v14
- run: sbt docker:publish
- uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
cache: 'sbt'
- uses: sbt/setup-sbt@ce95da69b39609ea153bad087708da5f37366897 # v1, specifically v1.5.10
- run: sbt Docker/publish
7 changes: 6 additions & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
version = 3.8.3
maxColumn = 120
runner.dialect = scala213
runner.dialect = scala213
fileOverride {
"glob:**.sbt" {
runner.dialect = scala3
}
}
60 changes: 28 additions & 32 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import com.softwaremill.Publish.updateDocs
import com.softwaremill.UpdateVersionInDocs
import sbt.Def

val compileDocumentation: TaskKey[Unit] = taskKey[Unit]("Compiles documentation throwing away its output")

val http4sVersion = "0.23.28"
val circeVersion = "0.14.4"
val circeYamlVersion = "0.14.2"
Expand Down Expand Up @@ -41,28 +43,20 @@ lazy val dockerSettings = Seq(
Docker / version := { version.value.replace("+", "_") }
)

lazy val commonSettings: Seq[Def.Setting[_]] = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.sttp.livestub",
scalaVersion := "2.13.15",
scalafmtOnCompile := false,
scmInfo := Some(
ScmInfo(
url("https://github.com/softwaremill/livestub"),
"git@github.com:softwaremill/livestub.git"
)
),
updateDocs := Def.taskDyn {
val files1 =
UpdateVersionInDocs(sLog.value, organization.value, version.value, List(file("docs-sources") / "README.md"))
Def.task {
(docs / mdoc).toTask("").value
files1 ++ Seq(file("generated-docs"), file("README.md"))
}
}.value
commonSmlBuildSettings
ossPublishSettings

organization := "com.softwaremill.sttp.livestub"
scalaVersion := "2.13.18"
scalafmtOnCompile := false
scmInfo := Some(
ScmInfo(
url("https://github.com/softwaremill/livestub"),
"git@github.com:softwaremill/livestub.git"
)
)

lazy val app: Project = (project in file("app"))
.settings(commonSettings)
.enablePlugins(DockerPlugin)
.enablePlugins(JavaServerAppPackaging)
.settings(dockerSettings)
Expand All @@ -84,7 +78,6 @@ lazy val app: Project = (project in file("app"))
.dependsOn(api, openapi)

lazy val api: Project = (project in file("api"))
.settings(commonSettings)
.settings(
name := "livestub-api",
libraryDependencies ++= Seq(
Expand All @@ -95,7 +88,6 @@ lazy val api: Project = (project in file("api"))
)

lazy val sdk: Project = (project in file("sdk"))
.settings(commonSettings)
.settings(
name := "livestub-sdk",
libraryDependencies ++= Seq(
Expand All @@ -109,14 +101,8 @@ lazy val sdk: Project = (project in file("sdk"))
)
.dependsOn(api, app % Test)

val compileDocumentation: TaskKey[Unit] = taskKey[Unit]("Compiles documentation throwing away its output")
compileDocumentation := {
(docs / mdoc).toTask(" --out target/generated-doc").value
}

lazy val docs = project
.in(file("generated-docs")) // important: it must not be docs/
.settings(commonSettings)
.enablePlugins(MdocPlugin)
.settings(
publishArtifact := false,
Expand All @@ -133,7 +119,6 @@ lazy val docs = project

lazy val openapi = project
.in(file("openapi"))
.settings(commonSettings)
.settings(
name := "openapi",
libraryDependencies ++= Seq(
Expand All @@ -143,7 +128,18 @@ lazy val openapi = project
) ++ jsonDependencies
)

lazy val rootProject = (project in file("."))
.settings(commonSettings)
.settings(publishArtifact := false, name := "livestub")
.aggregate(app, api, sdk, docs, openapi)
lazy val root = rootProject
.settings(
publishArtifact := false,
name := "livestub",
updateDocs := Def.uncached(Def.taskDyn {
val files1 =
UpdateVersionInDocs(sLog.value, organization.value, version.value, List(file("docs-sources") / "README.md"))
Def.task {
(docs / mdoc).toTask("").value
files1 ++ Seq(file("generated-docs"), file("README.md"))
}
}.value),
compileDocumentation := (docs / mdoc).toTask(" --out target/generated-doc").value
)
.autoAggregate
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.10.2
sbt.version=2.0.9
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % "2.0.20")
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % "2.0.20")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.10.4")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.6.1")
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % "3.0.1")
addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % "3.0.1")
addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.12.0")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.9.2")
Loading