Use sbt-publish-rsync rather than our own (#28868)

This commit is contained in:
Arnout Engelen 2020-04-28 11:49:42 +02:00 committed by GitHub
parent 6b5d544deb
commit ad2bd70213
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 33 deletions

View file

@ -12,7 +12,7 @@ import sbtunidoc.GenJavadocPlugin.autoImport._
import sbt.Keys._
import sbt.File
import scala.annotation.tailrec
import DeployRsync.autoImport.deployRsyncArtifacts
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncArtifacts
import sbt.ScopeFilter.ProjectFilter
@ -138,7 +138,7 @@ object UnidocRoot extends AutoPlugin {
if (JdkOptions.isJdk8) Seq("-Xdoclint:none")
else Seq("-Xdoclint:none", "--ignore-source-errors", "--no-module-directories")
},
deployRsyncArtifacts ++= {
publishRsyncArtifacts ++= {
val releaseVersion = if (isSnapshot.value) "snapshot" else version.value
(Compile / unidoc).value match {
case Seq(japi, api) =>

View file

@ -7,7 +7,7 @@ package akka
import com.lightbend.paradox.sbt.ParadoxPlugin
import com.lightbend.paradox.sbt.ParadoxPlugin.autoImport._
import com.lightbend.paradox.apidoc.ApidocPlugin
import DeployRsync.autoImport.deployRsyncArtifacts
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport._
import sbt.Keys._
import sbt._
@ -77,7 +77,7 @@ object Paradox {
name in (Compile, paradox) := "Akka",
resolvers += Resolver.jcenterRepo,
ApidocPlugin.autoImport.apidocRootPackage := "akka",
deployRsyncArtifacts += {
publishRsyncArtifacts += {
val releaseVersion = if (isSnapshot.value) "snapshot" else version.value
((Compile / paradox).value -> s"www/docs/akka/$releaseVersion")
})

View file

@ -8,6 +8,7 @@ import sbt._
import sbt.Keys._
import java.io.File
import sbtwhitesource.WhiteSourcePlugin.autoImport.whitesourceIgnore
import com.lightbend.sbt.publishrsync.PublishRsyncPlugin.autoImport.publishRsyncHost
object Publish extends AutoPlugin {
@ -18,6 +19,7 @@ object Publish extends AutoPlugin {
override lazy val projectSettings = Seq(
pomExtra := akkaPomExtra,
publishTo := Some(akkaPublishTo.value),
publishRsyncHost := "akkarepo@gustav.akka.io",
credentials ++= akkaCredentials,
organizationName := "Lightbend Inc.",
organizationHomepage := Some(url("https://www.lightbend.com")),
@ -61,27 +63,3 @@ object NoPublish extends AutoPlugin {
override def projectSettings =
Seq(skip in publish := true, sources in (Compile, doc) := Seq.empty, whitesourceIgnore := true)
}
object DeployRsync extends AutoPlugin {
import scala.sys.process._
import sbt.complete.DefaultParsers._
override def requires = plugins.JvmPlugin
trait Keys {
val deployRsyncArtifacts = taskKey[Seq[(File, String)]]("File or directory and a path to deploy to")
val deployRsync = inputKey[Unit]("Deploy using rsync")
}
object autoImport extends Keys
import autoImport._
override def projectSettings = Seq(
deployRsyncArtifacts := List(),
deployRsync := {
val (_, host) = (Space ~ StringBasic).parsed
deployRsyncArtifacts.value.foreach {
case (from, to) => s"rsync -rvz $from/ $host:$to" !
}
})
}

View file

@ -25,3 +25,4 @@ addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.6.0")
addSbtPlugin("com.hpe.sbt" % "sbt-pull-request-validator" % "1.0.0")
addSbtPlugin("net.bzzt" % "sbt-reproducible-builds" % "0.24")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")
addSbtPlugin("com.lightbend.sbt" % "sbt-publish-rsync" % "0.2")

View file

@ -322,11 +322,11 @@ fi
echolog "Building docs and pushing to the server..."
if [ $dry_run ]; then
echodry "Not actually pushing to server. Commands:"
echodry " sbt $RELEASE_OPT deployRsync"
echodry " sbt $RELEASE_OPT publishRsync"
else
important ssh ${release_server} "cd ${release_path}/docs/akka; git add .; git commit -m 'before publishing version $version'; true"
# using Scala 2.13 here to avoid the infamous problem with missing AskSupport in classpath
important sbt -Dakka.build.scalaVersion=2.13.0 $RELEASE_OPT "deployRsync ${release_server}"
important sbt -Dakka.build.scalaVersion=2.13.0 $RELEASE_OPT publishRsync"
important ssh ${release_server} "cd ${release_path}/docs/akka; git add .; git commit -m 'publish version $version'"
fi