Skip to content

Commit

Permalink
Publish to Sonatype / Maven Central
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffmay committed Apr 20, 2021
1 parent 5d4689c commit 64b9a7e
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
16 changes: 10 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,24 +1,28 @@
import Dependencies._

name := "play-json-ops-root"
scalaVersion := Scala_2_13

ThisBuild / organization := "com.rallyhealth"
ThisBuild / organizationName := "Rally Health"

ThisBuild / bintrayOrganization := Some("rallyhealth")
ThisBuild / bintrayRepository := "maven"

scalaVersion := Scala_2_13
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))

ThisBuild / homepage := Some(url("https://github.com/rallyhealth/play-json-ops"))
ThisBuild / developers := List(
Developer(id = "jeffmay", name = "Jeff May", email = "[email protected]", url = url("https://github.com/jeffmay")),
)

ThisBuild / resolvers += "Typesafe Releases" at "https://repo.typesafe.com/typesafe/releases/"
// TODO: This is still needed for MiMa binary compatibility checking, but can be removed on the next version
ThisBuild / resolvers += Resolver.bintrayRepo("rallyhealth", "maven")

// reload sbt when the build files change
Global / onChangedBuildSource := ReloadOnSourceChanges

// don't publish the aggregate root project
publish / skip := true
publishLocal / skip := true
skip / publish := true

// don't search for previous artifact of the root project
mimaFailOnNoPrevious := false
Expand Down
7 changes: 1 addition & 6 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
resolvers += Resolver.url(
"bintray-sbt-plugin-releases",
url("https://dl.bintray.com/content/sbt/sbt-plugin-releases")
)(Resolver.ivyStylePatterns)

addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "0.8.1")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.6.1")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7")
22 changes: 22 additions & 0 deletions sonatype.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Your profile name of the sonatype account. The default is the same with the organization value
sonatypeProfileName := "com.rallyhealth"

// To sync with Maven central, you need to supply the following information:
publishMavenStyle := true

// publish to Maven Central
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / publishTo := Some {
if (isSnapshot.value)
Resolver.url("Sonatype", url("https://s01.oss.sonatype.org/content/repositories/snapshots"))
else
Resolver.url("Sonatype", url("https://s01.oss.sonatype.org/content/repositories/releases"))
}

// add SNAPSHOT to non-release versions so they are not published to the main repo
ThisBuild / dynverSonatypeSnapshots := true
// Use '-' instead of '+' for simpler snapshot URLs
ThisBuild / dynverSeparator := "-"

import xerial.sbt.Sonatype.GitHubHosting
sonatypeProjectHosting := Some(GitHubHosting("rallyhealth", "play-json-ops", "[email protected]"))

0 comments on commit 64b9a7e

Please sign in to comment.