-
Notifications
You must be signed in to change notification settings - Fork 100
/
publishing.sbt
37 lines (32 loc) · 1.56 KB
/
publishing.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
ThisBuild / organization := "org.scalamock"
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
ThisBuild / scmInfo := Some(
ScmInfo(url("https://github.com/paulbutcher/ScalaMock"), "scm:git:[email protected]:paulbutcher/ScalaMock.git")
)
ThisBuild / developers := List(
Developer("paulbutcher", "Paul Butcher", "", url("http://paulbutcher.com/")),
Developer("barkhorn", "Philipp Meyerhoefer", "", url("https://github.com/barkhorn"))
)
ThisBuild / homepage := Some(url("http://scalamock.org/"))
//ThisBuild / pomIncludeRepository := { _ => false }
ThisBuild / version := {
val Snapshot = """(\d+)\.(\d+)\.(\d+)-\d+.*?""".r
git.gitDescribedVersion.value.getOrElse("0.0.0-1")match {
case Snapshot(maj, min, _) => s"$maj.${min.toInt + 1}.0-SNAPSHOT"
case v => v
}
}
ThisBuild / isSnapshot := version.value.endsWith("-SNAPSHOT")
ThisBuild / publishTo := {
if (isSnapshot.value) Opts.resolver.sonatypeOssSnapshots.headOption else Some(Opts.resolver.sonatypeStaging)
}
ThisBuild / publishConfiguration := publishConfiguration.value.withOverwrite(true)
ThisBuild / publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true)
addCommandAlias("ci-all", ";+clean ;+compile ;+test ;+package")
addCommandAlias("release", ";+scalamockJVM/publishSigned ;+scalamockJS/publishSigned ;sonatypeReleaseAll")
credentials ++= (
for {
u <- Option(System.getenv().get("SONATYPE_USERNAME"))
p <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", u, p)
).toSeq