diff --git a/.travis.yml b/.travis.yml index 0a698ff26ab..cd88f80e641 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,11 @@ sudo: false jdk: openjdk8 +branches: + only: + - master + - /^\d+\.\d+\.x$/ + cache: directories: $HOME/.cache/coursier @@ -25,8 +30,10 @@ before_script: - if [ $OLDEST_SHARED == $OLDEST_COMMIT ]; then git fetch --unshallow; fi stages: - - prepare - - test + - name: prepare + - name: test + - name: release + if: ((branch = master) OR (branch =~ /^\d+\.\d+\.x$/)) AND (type = push) AND (NOT fork) # We do not use the built-in tests as generated by using multiple Scala # versions because the cache is not shared between stages with any @@ -136,3 +143,7 @@ jobs: script: - benchmark/scripts/benchmark_cold_compile.py -N 2 --designs regress/ICache.fir --versions HEAD - benchmark/scripts/find_heap_bound.py -- -cp firrtl*jar firrtl.stage.FirrtlMain -i regress/ICache.fir -o out -X verilog + # run ci-release only if previous stages passed + - stage: release + name: "Publish SNAPSHOT release" + script: sbt ci-release diff --git a/build.sbt b/build.sbt index 8c5aa8b58e5..9a4e640906e 100644 --- a/build.sbt +++ b/build.sbt @@ -90,7 +90,7 @@ lazy val antlrSettings = Seq( ) lazy val publishSettings = Seq( - publishMavenStyle := true, + // publishMavenStyle and publishTo handled by sbt-ci-release publishArtifact in Test := false, pomIncludeRepository := { x => false }, // Don't add 'scm' elements if we have a git.remoteRepo definition, @@ -114,15 +114,6 @@ lazy val publishSettings = Seq( http://www.eecs.berkeley.edu/~jrb/ , - publishTo := { - val v = version.value - val nexus = "https://oss.sonatype.org/" - if (v.trim.endsWith("SNAPSHOT")) { - Some("snapshots" at nexus + "content/repositories/snapshots") - } else { - Some("releases" at nexus + "service/local/staging/deploy/maven2") - } - } ) diff --git a/project/plugins.sbt b/project/plugins.sbt index fb53038547b..346e2560e38 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -24,4 +24,6 @@ addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "3.0.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.0") +addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.4") + libraryDependencies += "com.github.os72" % "protoc-jar" % "3.11.4"