diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b824890..24cc8eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,8 @@ name: CI on: push: + tags: + - '*' branches: - main pull_request: diff --git a/build.sbt b/build.sbt index 6cfb064..b1ea1fb 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,16 @@ lazy val V = new { } ThisBuild / organization := "com.twitter.multiversion" -ThisBuild / version := "0.1.0-SNAPSHOT" +ThisBuild / version := { + val snapshotV = "0.1.0-SNAPSHOT" + val old = (ThisBuild / version).value + (sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")) match { + case Some(v) => v + case _ => + if ((ThisBuild / isSnapshot).value) snapshotV + else old + } +} ThisBuild / homepage := Some(url("https://github.com/twitter/bazel-multiversion")) ThisBuild / licenses := List( "Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0") diff --git a/project/plugins.sbt b/project/plugins.sbt index 1a6520a..e1fc250 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -7,3 +7,4 @@ addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.3") addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.19") addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.1") addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0") +addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.0.0")