You can do it by changing the release process with your own custom steps.
Basically I just copied the steps from the sbt-release
code, and added some of mine own
lazy val deploySettings: Seq[Def.Setting[_]] = {
import ReleaseTransformations._
import ReleasePlugin.autoImport._
import sbtrelease.{Git, Utilities, ExtraReleaseCommands}
import Utilities._
val deployBranch = "master"
def merge: (State) => State = { st: State =>
val git = st.extract.get(releaseVcs).get.asInstanceOf[Git]
val curBranch = (git.cmd("rev-parse", "--abbrev-ref", "HEAD") !!).trim
st.log.info(s"####### current branch: $curBranch")
git.cmd("checkout", deployBranch) ! st.log
st.log.info(s"####### pull $deployBranch")
git.cmd("pull") ! st.log
st.log.info(s"####### merge")
git.cmd("merge", curBranch, "--no-ff", "--no-edit") ! st.log
st.log.info(s"####### push")
git.cmd("push", "origin", s"$deployBranch:$deployBranch") ! st.log
st.log.info(s"####### checkout $curBranch")
git.cmd("checkout", curBranch) ! st.log
st
}
lazy val mergeReleaseVersionAction = { st: State =>
val newState = merge(st)
newState
}
val mergeReleaseVersion = ReleaseStep(mergeReleaseVersionAction)
publishingSettings ++
Seq(
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
pushChanges, //to make sure develop branch is pulled
mergeReleaseVersion, //will merge into master and push
tagRelease,
setNextVersion,
commitNextVersion,
pushChanges
)
)
}
it assumes that you are using git
not very pretty, but it works.