-
-
Notifications
You must be signed in to change notification settings - Fork 18
/
release.sbt
46 lines (37 loc) · 1.46 KB
/
release.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import sbtrelease._
// we hide the existing definition for setReleaseVersion to replace it with our own
import sbtrelease.ReleaseStateTransformations.{setReleaseVersion=>_,_}
def setVersionOnly(selectVersion: Versions => String): ReleaseStep = { st: State =>
val vs = st.get(ReleaseKeys.versions).getOrElse(sys.error("No versions are set! Was this release part executed before inquireVersions?"))
val selected = selectVersion(vs)
st.log.info("Setting version to '%s'." format selected)
val useGlobal =Project.extract(st).get(releaseUseGlobalVersion)
val versionStr = (if (useGlobal) globalVersionString else versionString) format selected
reapply(Seq(
if (useGlobal) ThisBuild / version := selected
else version := selected
), st)
}
lazy val setReleaseVersion: ReleaseStep = setVersionOnly(_._1)
releaseVersion := { ver =>
Version(ver)
.map(_.withoutQualifier)
.map(_.bump(releaseVersionBump.value).string).getOrElse(versionFormatError(ver))
}
releaseCrossBuild := false
releasePublishArtifactsAction := PgpKeys.publishSigned.value
sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"
publishTo := sonatypePublishToBundle.value
releaseProcess := Seq(
checkSnapshotDependencies,
inquireVersions,
setReleaseVersion,
runClean,
runTest,
tagRelease,
publishArtifacts,
releaseStepCommandAndRemaining("publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
pushChanges
)