diff --git a/README.md b/README.md index d96e3bf..3116700 100644 --- a/README.md +++ b/README.md @@ -44,3 +44,9 @@ Run code format and auto code refactor with scalafmt & scalafix: ```sh sbt prepare ``` + +### release + +```bash +sbt release with-defaults +``` diff --git a/build.sbt b/build.sbt index 89b4db0..4ffb1b5 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,6 @@ inThisBuild( Seq( scalaVersion := "3.4.2", versionScheme := Some("early-semver"), - version := "3.0", run / fork := true, run / javaOptions += "-Dconfig.override_with_env_vars=true", semanticdbEnabled := true, // for scalafix diff --git a/project/BuildPlugin.scala b/project/BuildPlugin.scala new file mode 100644 index 0000000..a8bf3cc --- /dev/null +++ b/project/BuildPlugin.scala @@ -0,0 +1,30 @@ +import sbt._, Keys._ +import sbt.ScriptedPlugin.autoImport._ +import sbtrelease.ReleasePlugin, ReleasePlugin.autoImport._, ReleaseTransformations._, ReleaseKeys._ +import sbt.ScriptedPlugin.autoImport._ + +import sbt.plugins.{JvmPlugin, SbtPlugin} + +object BuildPlugin extends AutoPlugin { + override def trigger = allRequirements + + override def requires = ReleasePlugin + + override lazy val projectSettings = releaseSettings + + def releaseSettings: Seq[Setting[_]] = + Seq( + releaseProcess := Seq[ReleaseStep]( + checkSnapshotDependencies, + inquireVersions, + runClean, + runTest, + setReleaseVersion, + commitReleaseVersion, + tagRelease, + setNextVersion, + commitNextVersion, + pushChanges + ) + ) +} diff --git a/project/plugins.sbt b/project/plugins.sbt index 2e81de2..8357846 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,3 +5,4 @@ addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") addSbtPlugin("org.typelevel" % "sbt-tpolecat" % "0.5.1") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.12.1") addSbtPlugin("nl.gn0s1s" % "sbt-dotenv" % "3.0.0") +addSbtPlugin("com.github.sbt" % "sbt-release" % "1.4.0") diff --git a/version.sbt b/version.sbt new file mode 100644 index 0000000..1ee5fbf --- /dev/null +++ b/version.sbt @@ -0,0 +1 @@ +ThisBuild / version := "3.0.0"