Skip to content

Commit

Permalink
Merge pull request #323 from lichess-org/sbt-release
Browse files Browse the repository at this point in the history
Add sbt-release plugin
  • Loading branch information
lenguyenthanh authored May 20, 2024
2 parents ed328c5 + 4d96717 commit 9e7eced
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ Run code format and auto code refactor with scalafmt & scalafix:
```sh
sbt prepare
```

### release

```bash
sbt release with-defaults
```
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 30 additions & 0 deletions project/BuildPlugin.scala
Original file line number Diff line number Diff line change
@@ -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
)
)
}
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
1 change: 1 addition & 0 deletions version.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ThisBuild / version := "3.0.0"

0 comments on commit 9e7eced

Please sign in to comment.