Skip to content

Commit

Permalink
Automatically publish SNAPSHOTs on pushes to master (#1955)
Browse files Browse the repository at this point in the history
Uses sbt-ci-release for automation
  • Loading branch information
jackkoenig authored Nov 12, 2020
1 parent c7bbb75 commit 06843bd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
15 changes: 13 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ sudo: false

jdk: openjdk8

branches:
only:
- master
- /^\d+\.\d+\.x$/

cache:
directories:
$HOME/.cache/coursier
Expand All @@ -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
Expand Down Expand Up @@ -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
11 changes: 1 addition & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -114,15 +114,6 @@ lazy val publishSettings = Seq(
<url>http://www.eecs.berkeley.edu/~jrb/</url>
</developer>
</developers>,
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")
}
}
)


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

0 comments on commit 06843bd

Please # to comment.