-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from 47deg/rafa-add-sonatype-settings
Add setting for publishing on Sonatype
- Loading branch information
Showing
11 changed files
with
131 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,6 @@ language: scala | |
scala: | ||
- 2.11.8 | ||
jdk: | ||
- oraclejdk8 | ||
- oraclejdk8 | ||
script: | ||
- sbt -Dtoken=$GITHUB4S_ACCESS_TOKEN test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
logLevel := Level.Warn | ||
logLevel := Level.Warn | ||
|
||
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.0.0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
organizationName := "47 Degrees" | ||
|
||
organizationHomepage := Some(new URL("http://47deg.com")) | ||
|
||
publishMavenStyle := true | ||
|
||
startYear := Some(2016) | ||
|
||
description := "GitHub API wrapper written in Scala" | ||
|
||
homepage := Some(url("http://47deg.com")) | ||
|
||
scmInfo := Some(ScmInfo(url("https://github.com/47deg/github4s"), "https://github.com/47deg/github4s.git")) | ||
|
||
pomExtra := | ||
<developers> | ||
<developer> | ||
<name>47 Degrees (twitter: @47deg)</name> | ||
<email>hello@47deg.com</email> | ||
</developer> | ||
<developer> | ||
<name>47 Degrees</name> | ||
</developer> | ||
</developers> | ||
|
||
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") | ||
} | ||
|
||
lazy val gpgFolder = sys.env.getOrElse("GPG_FOLDER", ".") | ||
|
||
pgpPassphrase := Some(sys.env.getOrElse("GPG_PASSPHRASE", "").toCharArray) | ||
|
||
pgpPublicRing := file(s"$gpgFolder/pubring.gpg") | ||
|
||
pgpSecretRing := file(s"$gpgFolder/secring.gpg") | ||
|
||
credentials += Credentials("Sonatype Nexus Repository Manager", | ||
"oss.sonatype.org", | ||
sys.env.getOrElse("PUBLISH_USERNAME", ""), | ||
sys.env.getOrElse("PUBLISH_PASSWORD", "")) | ||
|
||
publishArtifact in Test := false | ||
|
||
lazy val publishSnapshot = taskKey[Unit]("Publish only if the version is a SNAPSHOT") | ||
|
||
publishSnapshot := Def.taskDyn { | ||
if (isSnapshot.value) Def.task { PgpKeys.publishSigned.value } | ||
else Def.task(println("Actual version is not a Snapshot. Skipping publish.")) | ||
}.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/test/scala/com.fortysevendeg.github4s/integration/GHReposSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.fortysevendeg.github4s.integration | ||
|
||
import cats.Id | ||
import cats.scalatest.{XorMatchers, XorValues} | ||
import com.fortysevendeg.github4s.Github._ | ||
import com.fortysevendeg.github4s.GithubResponses._ | ||
import com.fortysevendeg.github4s.free.interpreters.IdInterpreters._ | ||
import com.fortysevendeg.github4s.{Github, TestUtils} | ||
import org.scalatest.{Matchers, FlatSpec} | ||
|
||
|
||
class GHReposSpec extends FlatSpec with Matchers with XorMatchers with XorValues with TestUtils { | ||
|
||
"Repos >> Get" should "return the expected name when valid repo is provided" in { | ||
|
||
val response = Github(accessToken).repos.get(validRepoOwner, validRepoName).exec[Id] | ||
response shouldBe right | ||
response.value.entity.name shouldBe validRepoName | ||
response.value.statusCode shouldBe okStatusCode | ||
} | ||
|
||
it should "return error when an invalid repo name is passed" in { | ||
val response = Github(accessToken).repos.get(validRepoOwner, invalidRepoName).exec[Id] | ||
response shouldBe left | ||
} | ||
|
||
"Repos >> ListCommits" should "return the expected list of commits for valid data" in { | ||
val response = Github(accessToken).repos.listCommits(validRepoOwner, validRepoName).exec[Id] | ||
response shouldBe right | ||
response.value.entity.nonEmpty shouldBe true | ||
response.value.statusCode shouldBe okStatusCode | ||
} | ||
|
||
it should "return error for invalid repo name" in { | ||
val response = Github(accessToken).repos.listCommits(invalidRepoName, validRepoName).exec[Id] | ||
response shouldBe left | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters