Skip to content

Commit

Permalink
Publish on tag (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
raboof authored May 4, 2018
1 parent eff74e0 commit dcef19b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: scala

scala:
- 2.12.5
- 2.12.6

jobs:
include:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -40,3 +48,9 @@ env:
global:
# encrypt with: travis encrypt WHITESOURCE_PASSWORD=...
- secure: "Xla2yMk15qjWY7bRzc/4dKUSIr8RhNzHSWZKF4qKzDbctxZcdeefH2r8YSn/STN9XH0/NgTBlYLn0Kfet3U/OU1ZoIPlH7NpSlWPl29KUHnECXGxItNgGA7XUapydJhItCWgswec7qnaeXjhwOrkrQeRdg/dLgQIcbMpdsCvkjP++xUevvS2OvP8dO4RSRDX/B6Q86NCT6zCwxm3MIaiYFY5t1topHcfHBP4n3G9L7FovhtGO/oTqagUe44YXLEY8PbXLLHECaK+KGjTsfH84aYWb8FhLL9va9dEO7tJXTQeRSu3d6o1Cty0aeK2hGZc0jr9Z+QbT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ypt 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="
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -158,6 +159,7 @@ lazy val docs = Project(
base = file("docs"),
)
.enablePlugins(AkkaParadoxPlugin)
.enablePlugins(akka.grpc.NoPublish)
.settings(
paradoxGroups := Map(
"Language" -> Seq("Scala", "Java"),
Expand Down Expand Up @@ -188,6 +190,7 @@ lazy val root = Project(
interopTests,
docs,
)
.enablePlugins(akka.grpc.NoPublish)
.settings(
unmanagedSources in (Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get
)
32 changes: 32 additions & 0 deletions project/Publish.scala
Original file line number Diff line number Diff line change
@@ -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")),
)
}

1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dcef19b

Please sign in to comment.