Skip to content

Commit

Permalink
Handle releases on Travis CI via sbt-ci-release
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Mar 11, 2019
1 parent f57c38f commit bd48eec
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
12 changes: 11 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
language: scala
jdk: openjdk8
git:
depth: false
cache:
directories:
- $HOME/.cache
- $HOME/.ivy2/cache
- $HOME/.sbt
script: sbt test
stages:
- name: test
- name: release
if: (branch = master AND type = push) OR (tag IS present)
jobs:
include:
- script: sbt test
- stage: release
script: sbt ci-release
12 changes: 12 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,15 @@ crossVersion := CrossVersion.disabled
// test stuff
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
fork.in(Test) := true // seems required for the tests to run fine

// sbt-dynver doesn't generate correct versions, because tags don't have a
// 'v' prefix, so we're overriding its logic here
version := {
import sys.process._
val describe = Seq("git", "describe", "--tags").!!.trim
val latestTag = Seq("git", "describe", "--tags", "--abbrev=0").!!.trim
if (describe == latestTag)
describe
else
describe + "-SNAPSHOT"
}
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.2.2")

0 comments on commit bd48eec

Please sign in to comment.