diff --git a/project/Publish.scala b/project/Publish.scala index 54cbc252ad..7e4b8c93bf 100644 --- a/project/Publish.scala +++ b/project/Publish.scala @@ -17,7 +17,7 @@ object Publish extends AutoPlugin { override lazy val projectSettings = Seq( pomExtra := akkaPomExtra, - publishTo := akkaPublishTo.value, + publishTo := Some(akkaPublishTo.value), credentials ++= akkaCredentials, organizationName := "Lightbend Inc.", organizationHomepage := Some(url("https://www.lightbend.com")), @@ -40,21 +40,16 @@ object Publish extends AutoPlugin { } private def akkaPublishTo = Def.setting { - sonatypeRepo(version.value).orElse(localRepo(defaultPublishTo.value)) + val key = new java.io.File( + Option(System.getProperty("akka.gustav.key")).getOrElse(System.getProperty("user.home") + "/.ssh/id_rsa_gustav.pem")) + if (isSnapshot.value) + Resolver.sftp("Akka snapshots", "gustav.akka.io", "/home/akkarepo/www/snapshots").as("akkarepo", key) + else + Opts.resolver.sonatypeStaging } - private def sonatypeRepo(version: String): Option[Resolver] = - Option(sys.props("publish.maven.central")).filter(_.toLowerCase == "true").map { _ => - val nexus = "https://oss.sonatype.org/" - if (version.endsWith("-SNAPSHOT")) "snapshots".at(nexus + "content/repositories/snapshots") - else "releases".at(nexus + "service/local/staging/deploy/maven2") - } - - private def localRepo(repository: File) = - Some(Resolver.file("Default Local Repository", repository)) - private def akkaCredentials: Seq[Credentials] = - Option(System.getProperty("akka.publish.credentials", null)).map(f => Credentials(new File(f))).toSeq + Option(System.getProperty("akka.publish.credentials")).map(f => Credentials(new File(f))).toSeq } /** diff --git a/project/scripts/release b/project/scripts/release index 847b5ca401..9670ec1366 100755 --- a/project/scripts/release +++ b/project/scripts/release @@ -64,7 +64,12 @@ # 3.2) Install your public ssh key to avoid typing in your password. # From the command line: # shell> cat ~/.ssh/id_rsa.pub | ssh akkarepo@gustav.akka.io "cat >> ~/.ssh/authorized_keys" -## +# +# 3.3) Also make it available for publishing snapshots. +# From the command line: +# shell> cp ~/.ssh/id_rsa.pub ~/.ssh/id_rsa_gustav.pem +# shell> ssh-keygen -p -f ~/.ssh/id_rsa_gustav.pem -m pem +# # 4) Have access to github.com/akka/akka. This should be a given. # # Now you should be all set to run the script