Skip to content

Commit

Permalink
feat(mercury): add release plugins for sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Baliasnikov committed Oct 21, 2022
1 parent 80281ec commit 8ad3be0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 15 deletions.
46 changes: 31 additions & 15 deletions mercury/prism-mediator/build.sbt
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._

val tapirVersion = "1.0.3"
val VERSION = "0.1.0-SNAPSHOT"

inThisBuild(
Seq(
organization := "io.iohk.atala",
scalaVersion := "3.2.0",
fork := true,
run / connectInput := true,
releaseUseGlobalVersion := false,
versionScheme := Some("semver-spec"),
githubOwner := "input-output-hk",
githubRepository := "atala-prism-building-blocks",
githubTokenSource := TokenSource.Environment("GITHUB_TOKEN")
)
)

Expand Down Expand Up @@ -71,7 +77,7 @@ lazy val D = new {
*/
lazy val models = project
.in(file("models"))
.settings(name := "mercury-data-models", version := VERSION)
.settings(name := "mercury-data-models")
.settings(
libraryDependencies ++= Seq(D.zio.value),
libraryDependencies ++= Seq(
Expand All @@ -89,22 +95,22 @@ lazy val models = project

lazy val protocolConnection = project
.in(file("protocol-connection"))
.settings(name := "mercury-protocol-connection", version := VERSION)
.settings(name := "mercury-protocol-connection")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.dependsOn(models, protocolInvitation)

lazy val protocolCoordinateMediation = project
.in(file("protocol-coordinate-mediation"))
.settings(name := "mercury-protocol-coordinate-mediation", version := VERSION)
.settings(name := "mercury-protocol-coordinate-mediation")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.settings(libraryDependencies += D.munitZio.value)
.dependsOn(models)

lazy val protocolInvitation = project
.in(file("protocol-invitation"))
.settings(name := "mercury-protocol-invitation", version := VERSION)
.settings(name := "mercury-protocol-invitation")
.settings(libraryDependencies += D.zio.value)
.settings(
libraryDependencies ++= Seq(
Expand All @@ -119,20 +125,20 @@ lazy val protocolInvitation = project

lazy val protocolDidExchange = project
.in(file("protocol-did-exchange"))
.settings(name := "mercury-protocol-did-exchange", version := VERSION)
.settings(name := "mercury-protocol-did-exchange")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
.dependsOn(models, protocolInvitation)

lazy val protocolMercuryMailbox = project
.in(file("protocol-mercury-mailbox"))
.settings(name := "mercury-protocol-mailbox", version := VERSION)
.settings(name := "mercury-protocol-mailbox")
.settings(libraryDependencies += D.zio.value)
.dependsOn(models, protocolInvitation, protocolRouting)

lazy val protocolLogin = project
.in(file("protocol-outofband-login"))
.settings(name := "mercury-protocol-outofband-login", version := VERSION)
.settings(name := "mercury-protocol-outofband-login")
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies += D.zio.value)
.settings(libraryDependencies ++= Seq(D.circeCore.value, D.circeGeneric.value, D.circeParser.value))
Expand All @@ -141,12 +147,12 @@ lazy val protocolLogin = project

lazy val protocolReportProblem = project
.in(file("protocol-report-problem"))
.settings(name := "protocol-report_problem", version := VERSION)
.settings(name := "protocol-report_problem")
.dependsOn(models)

lazy val protocolRouting = project
.in(file("protocol-routing"))
.settings(name := "mercury-protocol-routing-2_0", version := VERSION)
.settings(name := "mercury-protocol-routing-2_0")
.settings(libraryDependencies += D.zio.value)
.dependsOn(models)

Expand All @@ -157,7 +163,7 @@ lazy val protocolRouting = project
// TODO move stuff to the models module
lazy val resolver = project // maybe merge into models
.in(file("resolver"))
.settings(name := "mercury-resolver", version := VERSION)
.settings(name := "mercury-resolver")
.settings(
libraryDependencies ++= Seq(
D.didcommx.value,
Expand All @@ -178,7 +184,7 @@ lazy val resolver = project // maybe merge into models

lazy val agent = project // maybe merge into models
.in(file("agent"))
.settings(name := "mercury-agent-core") // , version := VERSION)
.settings(name := "mercury-agent-core")
.settings(libraryDependencies += "com.google.zxing" % "core" % "3.5.0")
.settings(libraryDependencies ++= Seq(D.zioLog.value, D.zioHttp.value)) // , D.zioSLF4J.value))
.dependsOn(
Expand All @@ -194,15 +200,15 @@ lazy val agent = project // maybe merge into models
/** Demos agents and services implementation with didcommx */
lazy val agentDidcommx = project
.in(file("agent-didcommx"))
.settings(name := "mercury-agent-didcommx", version := VERSION)
.settings(name := "mercury-agent-didcommx")
.settings(libraryDependencies += D.didcommx.value)
.dependsOn(agent)

///** TODO Demos agents and services implementation with did-scala */
lazy val agentDidScala =
project
.in(file("agent-did-scala"))
.settings(name := "mercury-agent-didscala", version := VERSION)
.settings(name := "mercury-agent-didscala")
.settings(
didScalaAUX,
if (useDidLib) (Compile / sources ++= Seq())
Expand All @@ -217,7 +223,7 @@ lazy val agentDidScala =
/** The mediator service */
lazy val mediator = project
.in(file("mediator"))
.settings(name := "mercury-mediator", version := VERSION)
.settings(name := "mercury-mediator")
.settings(
libraryDependencies ++= Seq( // TODO cleanup
"com.softwaremill.sttp.tapir" %% "tapir-http4s-server-zio" % tapirVersion,
Expand Down Expand Up @@ -258,3 +264,13 @@ lazy val mediator = project
protocolReportProblem,
protocolRouting,
)

releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
publishArtifacts,
setNextVersion
)
2 changes: 2 additions & 0 deletions mercury/prism-mediator/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
// addSbtPlugin("com.github.sbt" % "sbt-native-packager" % "1.9.11")
1 change: 1 addition & 0 deletions mercury/prism-mediator/version.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ThisBuild / version := "0.1.0-SNAPSHOT"

0 comments on commit 8ad3be0

Please sign in to comment.