-
Notifications
You must be signed in to change notification settings - Fork 91
/
publish.sbt
44 lines (32 loc) · 1.19 KB
/
publish.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
// --- maven publishing ---
publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
publishTo := {
val nexus = "https://oss.sonatype.org/"
val repo = if (version.value.trim.endsWith("SNAPSHOT"))
"snapshots" at nexus + "content/repositories/snapshots"
else
"releases" at nexus + "service/local/staging/deploy/maven2"
Some(repo)
}
// do not publish docs for snapshot releases
publishArtifact in (Compile, packageDoc) := !version.value.trim.endsWith("SNAPSHOT")
// `sbt release` should publish signed artifacts
releasePublishArtifactsAction := PgpKeys.publishSigned.value
pomExtra in Global := {
<developers>
<developer>
<id>tiarkrompf</id>
<name>Tiark Rompf</name>
<url>https://github.com/tiarkrompf</url>
</developer>
</developers>
}
// --- sonatype settings ---
sonatypeProfileName := "org.scala-lang"
credentials ++= (for {
username <- Option(System.getenv().get("SONATYPE_USER"))
password <- Option(System.getenv().get("SONATYPE_PASS"))
} yield Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", username, password)).toSeq
// NOTE: sonatypeRelease must be run explicitly, after `sbt release`