From 85ff4ab376dd8857845ebb02b3eda7dba9c635c5 Mon Sep 17 00:00:00 2001 From: eugene yokota Date: Wed, 12 Aug 2020 03:24:14 -0400 Subject: [PATCH] Set up sbt-ci-release (#34) --- .travis.yml | 37 ++++++++++++++++++++++++++----------- build.sbt | 9 ++++++++- project/plugins.sbt | 2 +- project/scripted.sbt | 3 --- version.sbt | 1 - 5 files changed, 35 insertions(+), 17 deletions(-) delete mode 100644 project/scripted.sbt delete mode 100644 version.sbt diff --git a/.travis.yml b/.travis.yml index 56eaa44..c6fb7fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,18 +1,27 @@ language: scala -matrix: + +stages: + - name: test + - name: release + if: (tag IS present) AND NOT fork + +jdk: openjdk8 + +jobs: include: - - env: SBT_VERSION="1.3.9" - jdk: openjdk8 - - env: SBT_VERSION="1.3.9" - jdk: openjdk11 + # stage="test" if no stage is specified + - name: jdk8 + jdk: openjdk8 + - name: jdk11 + jdk: openjdk11 + # run ci-release only if previous stages passed + - stage: release + script: sbt ci-release -script: sbt "^^ $SBT_VERSION" clean test scripted +before_install: + - git fetch --tags -cache: - directories: - - $HOME/.ivy2/cache - - $HOME/.cache/coursier - - $HOME/.sbt +script: sbt clean test scripted before_cache: # Cleanup the cached directories to avoid unnecessary cache updates @@ -20,3 +29,9 @@ before_cache: - find $HOME/.ivy2/cache -name "ivydata-*.properties" -print -delete - find $HOME/.cache/coursier -name -print -delete - find $HOME/.sbt -name "*.lock" -print -delete + +cache: + directories: + - $HOME/.ivy2/cache + - $HOME/.cache/coursier + - $HOME/.sbt diff --git a/build.sbt b/build.sbt index cff7bd9..57a690b 100644 --- a/build.sbt +++ b/build.sbt @@ -8,6 +8,13 @@ lazy val specs2Version = "4.9.3" // MANIFEST will however not make mention of the compileonly libs val CompileOnly = config("compileonly").hide +ThisBuild / dynverSonatypeSnapshots := true +ThisBuild / version := { + val orig = (ThisBuild / version).value + if (orig.endsWith("-SNAPSHOT")) "2.2.0-SNAPSHOT" + else orig +} + lazy val `sbt-avro`: Project = project .in(file(".")) .enablePlugins(SbtPlugin) @@ -30,11 +37,11 @@ lazy val `sbt-avro`: Project = project unmanagedClasspath in Compile ++= update.value.select(configurationFilter(CompileOnly.name)), licenses += ("BSD 3-Clause", url("https://github.com/sbt/sbt-avro/blob/master/LICENSE")), + publishTo := (bintray / publishTo).value, publishMavenStyle := false, bintrayOrganization := Some("sbt"), bintrayRepository := "sbt-plugin-releases", bintrayPackage := "sbt-avro2", - bintrayReleaseOnPublish := false, scriptedLaunchOpts := scriptedLaunchOpts.value ++ Seq( "-Xmx1024M", diff --git a/project/plugins.sbt b/project/plugins.sbt index 3d4385f..62c95e0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,2 @@ -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13") addSbtPlugin("org.foundweekends" %% "sbt-bintray" % "0.5.6") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") diff --git a/project/scripted.sbt b/project/scripted.sbt deleted file mode 100644 index 529e7d6..0000000 --- a/project/scripted.sbt +++ /dev/null @@ -1,3 +0,0 @@ -libraryDependencies += { - "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value -} diff --git a/version.sbt b/version.sbt deleted file mode 100644 index 5051b75..0000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version in ThisBuild := "3.0.0-SNAPSHOT"