Skip to content

Commit

Permalink
Fix #5: Use sbt-sonatype for publishing
Browse files Browse the repository at this point in the history
Mostly stolen from circe-yaml.
  • Loading branch information
jonas committed Aug 22, 2017
1 parent 8e74928 commit c9d64f4
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
39 changes: 29 additions & 10 deletions build.sbt
Expand Up @@ -5,21 +5,14 @@ homepage := Some(url("https://github.com/circe/circe-config"))
licenses += "Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html")
apiURL := Some(url("https://circe.github.io/circe-config/api/"))

crossScalaVersions := Seq("2.11.11", "2.12.3")
scalaVersion := crossScalaVersions.value.last

enablePlugins(GitPlugin)
versionWithGit
git.useGitDescribe := true

enablePlugins(BintrayPlugin)
bintrayRepository := "maven"
bintrayOrganization := Some("fonseca")
publishArtifact in Test := false
publishMavenStyle := true
git.remoteRepo := "git@github.com:circe/circe-circe.git"

enablePlugins(ReleasePlugin)
releaseCrossBuild := true
releasePublishArtifactsAction := PgpKeys.publishSigned.value
releaseTagName := (version in ThisBuild).value
releaseVersionFile := target.value / "unused-version.sbt"
releaseProcess := {
Expand All @@ -34,7 +27,8 @@ releaseProcess := {
setReleaseVersion,
tagRelease,
publishArtifacts,
pushChanges
pushChanges,
releaseStepTask(ghpagesPushSite)
)
}

Expand All @@ -57,7 +51,10 @@ libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % Versions.scalaTest % Test
)

enablePlugins(GhpagesPlugin, SiteScaladocPlugin)
autoAPIMappings := true
ghpagesNoJekyll := true
siteSubdirName in SiteScaladoc := "api"
doctestTestFramework := DoctestTestFramework.ScalaTest
doctestMarkdownEnabled := true
doctestWithDependencies := false
Expand Down Expand Up @@ -85,6 +82,28 @@ scalacOptions ++= Seq(
scalacOptions in (Compile, console) ~= { _.filterNot(Set("-Ywarn-unused-import")) }
scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value

publishMavenStyle := true
publishArtifact in Test := false
pomIncludeRepository := { _ => false }
publishTo := {
val nexus = "https://oss.sonatype.org/"
if (isSnapshot.value)
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}
credentials ++= (
for {
username <- Option(System.getenv().get("SONATYPE_USERNAME"))
password <- Option(System.getenv().get("SONATYPE_PASSWORD"))
} yield Credentials(
"Sonatype Nexus Repository Manager",
"oss.sonatype.org",
username,
password
)
).toSeq

scmInfo := Some(
ScmInfo(
url("https://github.com/circe/circe-config"),
Expand Down
10 changes: 7 additions & 3 deletions project/plugins.sbt
@@ -1,4 +1,8 @@
addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.4")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.8.5")
addSbtPlugin("com.dwijnand" % "sbt-travisci" % "1.1.0")
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.5")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.0")
addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "1.1")
addSbtPlugin("com.github.tkawachi" % "sbt-doctest" % "0.5.0")

0 comments on commit c9d64f4

Please sign in to comment.