From 15905c86c13cd67dd9fdec82d8bbee56da07b734 Mon Sep 17 00:00:00 2001 From: Julien Lafont Date: Sun, 7 Jun 2020 19:20:28 +0200 Subject: [PATCH] Remoe SBT-Release process, not adapted to client/server mixed repository --- server/build.sbt | 5 +-- server/project/SbtReleaseProcess.scala | 51 -------------------------- server/project/plugins.sbt | 1 - server/version.sbt | 1 - 4 files changed, 1 insertion(+), 57 deletions(-) delete mode 100644 server/project/SbtReleaseProcess.scala delete mode 100644 server/version.sbt diff --git a/server/build.sbt b/server/build.sbt index 495296b..de19945 100644 --- a/server/build.sbt +++ b/server/build.sbt @@ -4,6 +4,7 @@ import com.typesafe.sbt.packager.MappingsHelper.directory lazy val root = (project in file(".")) .settings( name := "mocky-2020", + version in ThisBuild := "3.0.0", scalaVersion := "2.13.2", maintainer := "yotsumi.fx+github@gmail.com", resolvers += Resolver.bintrayRepo("tabmo", "maven"), @@ -28,7 +29,3 @@ lazy val root = (project in file(".")) // Automatically reload project when build files are modified Global / onChangedBuildSource := ReloadOnSourceChanges - -// Customize the sbt-release steps to follow gitflow process -releaseProcess := SbtReleaseProcess.steps -releaseIgnoreUntrackedFiles := true diff --git a/server/project/SbtReleaseProcess.scala b/server/project/SbtReleaseProcess.scala deleted file mode 100644 index 97d8dc0..0000000 --- a/server/project/SbtReleaseProcess.scala +++ /dev/null @@ -1,51 +0,0 @@ -object SbtReleaseProcess { - - import sbt._ - import sbtrelease.ReleasePlugin.autoImport._ - import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._ - import sbtrelease.Git - import sbtrelease.Utilities._ - - private def getGITreference(st: State): Git = st.extract.get(releaseVcs).get.asInstanceOf[Git] - - /** - * Merge the `devBranch` into the `deployBranch`. - * Usually, merge the develop branch into master - */ - private def mergeReleaseVersion(devBranch: String, deployBranch: String): (State) => State = { st: State => - val git = getGITreference(st) - st.log.info(s"Merging $devBranch in $deployBranch") - git.cmd("checkout", deployBranch) ! st.log - git.cmd("pull") ! st.log - git.cmd("merge", devBranch, "--no-edit") ! st.log - git.cmd("push", "origin", s"$deployBranch:$deployBranch") ! st.log - git.cmd("checkout", devBranch) ! st.log - st.log.info("Merge complete with success") - st - } - - /** - * Check if the repository is currently on the required branch - */ - private def checkCurrentBranch(requiredBranch: String): (State) => State = { st: State => - val git = getGITreference(st) - val currentBranch = (git.cmd("rev-parse", "--abbrev-ref", "HEAD") !!).trim - if (currentBranch != requiredBranch) - sys.error( - s"You must be on the $requiredBranch branch to release a version. Actually you're on the $currentBranch") - st - } - - val steps = Seq[ReleaseStep]( - checkCurrentBranch("develop"), - inquireVersions, - setReleaseVersion, - commitReleaseVersion, - mergeReleaseVersion("develop", "master"), - tagRelease, - setNextVersion, - commitNextVersion, - pushChanges - ) - -} diff --git a/server/project/plugins.sbt b/server/project/plugins.sbt index 00dfdc7..21a2678 100644 --- a/server/project/plugins.sbt +++ b/server/project/plugins.sbt @@ -4,4 +4,3 @@ addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0") addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.7.2") addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.11") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13") diff --git a/server/version.sbt b/server/version.sbt deleted file mode 100644 index 95c0f0e..0000000 --- a/server/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version in ThisBuild := "0.1.10-SNAPSHOT"