Skip to content

Commit 5912c3a

Browse files
authored
Publish to Sonatype / Maven Central (#21)
* Publish to sonatype / Maven Central * Update Travis to download sbt
1 parent 43301a1 commit 5912c3a

File tree

4 files changed

+29
-7
lines changed

4 files changed

+29
-7
lines changed

.travis.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@ scala:
44
- 2.12.6
55
jdk:
66
- openjdk8
7+
8+
before_script:
9+
# Download sbt because Travis can't find it automatically :(
10+
- mkdir -p $HOME/.sbt/launchers/1.2.8/
11+
- 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
12+
713
script:
814
- sbt ^test ^scripted
15+

build.sbt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
import sbt.plugins.SbtPlugin
22

33
name := "sbt-git-versioning"
4-
organizationName := "Rally Health"
5-
organization := "com.rallyhealth.sbt"
4+
ThisBuild / organizationName := "Rally Health"
5+
ThisBuild / organization := "com.rallyhealth.sbt"
66

7-
licenses := Seq("MIT" -> url("http://opensource.org/licenses/MIT"))
8-
9-
bintrayOrganization := Some("rallyhealth")
10-
bintrayRepository := "sbt-plugins"
7+
ThisBuild / licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))
118

129
// SbtPlugin requires sbt 1.2.0+
1310
// See: https://developer.lightbend.com/blog/2018-07-02-sbt-1-2-0/#sbtplugin-for-plugin-development

project/plugins.sbt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ resolvers += Resolver.url(
33
url("https://dl.bintray.com/rallyhealth/sbt-plugins"))(Resolver.ivyStylePatterns)
44

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

sonatype.sbt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Your profile name of the sonatype account. The default is the same with the organization value
2+
sonatypeProfileName := "com.rallyhealth"
3+
4+
// To sync with Maven central, you need to supply the following information:
5+
publishMavenStyle := true
6+
7+
// publish to Maven Central
8+
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
9+
ThisBuild / publishTo := Some {
10+
if (isSnapshot.value)
11+
Resolver.url("Sonatype", url("https://s01.oss.sonatype.org/content/repositories/snapshots"))
12+
else
13+
Resolver.url("Sonatype", url("https://s01.oss.sonatype.org/content/repositories/releases"))
14+
}
15+
16+
import xerial.sbt.Sonatype.GitHubHosting
17+
sonatypeProjectHosting := Some(GitHubHosting("rallyhealth", "sbt-git-versioning", "jeff.n.may@gmail.com"))

0 commit comments

Comments
 (0)