From dcef19bc8a83eceb8d36d8c699f4d2d222f4be10 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 4 May 2018 16:31:53 +0200 Subject: [PATCH] Publish on tag (#200) --- .travis.yml | 16 +++++++++++++++- build.sbt | 5 ++++- project/Publish.scala | 32 ++++++++++++++++++++++++++++++++ project/plugins.sbt | 1 + 4 files changed, 52 insertions(+), 2 deletions(-) create mode 100644 project/Publish.scala diff --git a/.travis.yml b/.travis.yml index 3f6b8e007..84c0978dd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: scala scala: - - 2.12.5 + - 2.12.6 jobs: include: @@ -18,6 +18,10 @@ jobs: script: git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" && sbt whitesourceCheckPolicies whitesourceUpdate - stage: whitesource-release script: git branch -f "$TRAVIS_BRANCH" && git checkout "$TRAVIS_BRANCH" && sbt whitesourceCheckPolicies whitesourceUpdate + - stage: publish + script: sbt publish + - stage: techhub-ping + script: curl -I https://ci.lightbend.com/job/techhub-publisher/build?token=$TECH_HUB_TOKEN stages: - name: tests @@ -26,6 +30,10 @@ stages: if: repo = akka/akka-grpc AND branch = master AND type = push - name: whitesource-release if: repo = akka/akka-grpc AND tag =~ ^v + - name: publish + if: repo = akka/akka-grpc AND tag =~ ^v + - name: techhub-ping + if: repo = akka/akka-grpc AND tag =~ ^v before_cache: - find $HOME/.ivy2 -name "ivydata-*.properties" -print -delete @@ -40,3 +48,9 @@ env: global: # encrypt with: travis encrypt WHITESOURCE_PASSWORD=... - secure: "Xla2yMk15qjWY7bRzc/4dKUSIr8RhNzHSWZKF4qKzDbctxZcdeefH2r8YSn/STN9XH0/NgTBlYLn0Kfet3U/OU1ZoIPlH7NpSlWPl29KUHnECXGxItNgGA7XUapydJhItCWgswec7qnaeXjhwOrkrQeRdg/dLgQIcbMpdsCvkjP++xUevvS2OvP8dO4RSRDX/B6Q86NCT6zCwxm3MIaiYFY5t1topHcfHBP4n3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i7NmXTgCuCBKV8XouKWqSAD+RCKZzoD3yoOY4oOA3oLtKtfltaTciaPo/T1gg2TYHL0h2IHFVuOZeUmOaU4JqkCpkMT/8=" + # encrypt with: travis encrypt BINTRAY_PASS=... (bintray token, not password) + - secure: "akusg/u0bTODgL3hyJ8iCEjbPQ7pFuLubUZ8k0yZl34IxHqu4OX3uT42zd+OG/ZFwFhNY+90GKDwe51FyTugk16KNZGzkXnDbIKtjn/x5KbCgMPCHojC4/Mbjjp7OAla/8uphYz00nsgZq8IaB2/7aYIWb24juOmtRqyrRxlrW2Pqx5rbh7QU9v3aFNT0lIW8ro6rWVEd0eiltXxUxH+ZmNpXMco/6DXiQfIuWDSU2D8xKzri+FG1fsh8L+LqpkW1zulBBQj1p1Fg/LpQ40pUcjWNNxDLnLEbUZoRdvyv0iz2QqwJCxyzSs3xbAkBPslrFD11eWtgu1MrqeID7h+WJUL68rozdk1NsBj4E3vdD2rbTxJiRmhUEVhrdSpJKhNo9cuUlpMF3eWZEh/JTTDPskW3dHExx/hIoK2YNCYoUZu6gDc24rzeCB6k966DITFyTga4rm8Xmm+E0KkfOnv5FjDEii9RXAb9HxauYRebLr1XBdcRGj0TTZNZfAXxgMIrusi+Awqj4019WY5Gy+o3AXoVQWr35hW0eRe3pDKQ4zCE0BS/SwZPq9YL/MZApVa4jXXb/pRLnF2MRt8Tg9JE7j0t/k38VAX1DZBQyFQFbYwcEwlfvx2a/IdYZ6mEmWcKTWBVpj5tT7FPWCFeT5+nFMgEASTbjEOlnweCnDz1fk=" + # encrypt with: travis encrypt TECH_HUB_TOKEN=... + - secure: "sFbpTppagGo56idzNXn3qOYwtRb8q/+Zjcen7KV3uNno3U1asfKVNoEj6UMxwCnmPn8BnrRtq2aVHIjDmItDwMHEPQ51Wm+0hxAw15o9yh15/MIoc+yu+VfOSXAYb9pEcMVbIyYzyR/qi2vsBTIJuloUDK/KPmmrUldx1hgFd567WmwHiXwiu/4BePWqsXGiCEjq5nQuO5XS+4uFDdpXlfX6wcQsU6o2ztD60wNAQwdDL751d8TNZNajWi5R9fD7xWV2wsewhGhl5E43o/HiY+Z/h1Kt/f3UGbhj7vZNTHAd901ZEG9QacFxQXaQWYOutlrO+eDBgRKd+27PLNpTLymF1Ht47xcERjpH0lgps02pDoSoFGzRYoHNQYAjA2BXK3GZHcLYmnPCB+5pbw1D4lsX8xQ8y5yO29gE4uCTx7P15bVt7/KbgUTdWfLtOQGyOd/jS9RTplHNAG2fBW2pa5nS4KNmON1UO3vNcsWv/zEHv48ASSLxpC3NxWkwS+zOkt0uORyXlxi0teOajWA7dmalC+9VpKf5kuAZvKM0xYxN5Yqt+6UELtTQnle3fTLnKcE584+eo/RdCgvGD6N0RJHN/UKl7sP7hvTF7w/SbcAaI/jv31N+oVV79UyMLqm1U8HRGg2HLMSHiRbYFSOYmsQ5/sYWn7RsJIroDKpFd+I=" diff --git a/build.sbt b/build.sbt index fbeccd035..83bad1f56 100644 --- a/build.sbt +++ b/build.sbt @@ -85,8 +85,9 @@ lazy val sbtPlugin = Project( .settings(Dependencies.sbtPlugin) .settings( Keys.sbtPlugin := true, - publishTo := Some(Classpaths.sbtPluginReleases), publishMavenStyle := false, + bintrayPackage := "sbt-akka-grpc", + bintrayRepository := "sbt-plugin-releases", /** And for scripted tests: */ scriptedLaunchOpts += ("-Dproject.version=" + version.value), @@ -158,6 +159,7 @@ lazy val docs = Project( base = file("docs"), ) .enablePlugins(AkkaParadoxPlugin) + .enablePlugins(akka.grpc.NoPublish) .settings( paradoxGroups := Map( "Language" -> Seq("Scala", "Java"), @@ -188,6 +190,7 @@ lazy val root = Project( interopTests, docs, ) + .enablePlugins(akka.grpc.NoPublish) .settings( unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get ) diff --git a/project/Publish.scala b/project/Publish.scala new file mode 100644 index 000000000..34651e216 --- /dev/null +++ b/project/Publish.scala @@ -0,0 +1,32 @@ +package akka.grpc + +import sbt._, Keys._ + +/** + * For projects that are not to be published. + */ +object NoPublish extends AutoPlugin { + override def requires = plugins.JvmPlugin + + override def projectSettings = Seq( + publishArtifact := false, + publish := {}, + publishLocal := {}, + skip in publish := true, + ) +} + +object Publish extends AutoPlugin { + import bintray.BintrayPlugin + import bintray.BintrayPlugin.autoImport._ + + override def trigger = allRequirements + override def requires = BintrayPlugin + + override def projectSettings = Seq( + bintrayOrganization := Some("akka"), + bintrayPackage := "akka-grpc", + licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")), + ) +} + diff --git a/project/plugins.sbt b/project/plugins.sbt index 1308bbaf3..f37c13752 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -11,6 +11,7 @@ addSbtPlugin("com.lightbend.akka" % "sbt-paradox-akka" % "0.6") addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") addSbtPlugin("com.lightbend" % "sbt-whitesource" % "0.1.10") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "0.9.3") +addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.4") // scripted testing libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value