Skip to content

Commit

Permalink
Publish to Sonatype / Maven Central (#21)
Browse files Browse the repository at this point in the history
* Publish to sonatype / Maven Central
* Update Travis to download sbt
  • Loading branch information
jeffmay authored Apr 20, 2021
1 parent 43301a1 commit 5912c3a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,12 @@ scala:
- 2.12.6
jdk:
- openjdk8

before_script:
# Download sbt because Travis can't find it automatically :(
- mkdir -p $HOME/.sbt/launchers/1.2.8/
- curl -L -o $HOME/.sbt/launchers/1.2.8/sbt-launch.jar https://repo1.maven.org/maven2/org/scala-sbt/sbt-launch/1.2.8/sbt-launch-1.2.8.jar

script:
- sbt ^test ^scripted

9 changes: 3 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import sbt.plugins.SbtPlugin

name := "sbt-git-versioning"
organizationName := "Rally Health"
organization := "com.rallyhealth.sbt"
ThisBuild / organizationName := "Rally Health"
ThisBuild / organization := "com.rallyhealth.sbt"

licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT"))

bintrayOrganization := Some("rallyhealth")
bintrayRepository := "sbt-plugins"
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))

// SbtPlugin requires sbt 1.2.0+
// See: https://developer.lightbend.com/blog/2018-07-02-sbt-1-2-0/#sbtplugin-for-plugin-development
Expand Down
3 changes: 2 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ resolvers += Resolver.url(
url("https://dl.bintray.com/rallyhealth/sbt-plugins"))(Resolver.ivyStylePatterns)

addSbtPlugin("com.rallyhealth.sbt" % "sbt-git-versioning" % "1.3.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.0")

17 changes: 17 additions & 0 deletions sonatype.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// 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"))
}

import xerial.sbt.Sonatype.GitHubHosting
sonatypeProjectHosting := Some(GitHubHosting("rallyhealth", "sbt-git-versioning", "jeff.n.may@gmail.com"))

0 comments on commit 5912c3a

Please sign in to comment.