From 1e5676af95951cba0aee79cedbc4d103e838816e Mon Sep 17 00:00:00 2001 From: Tim Nieradzik Date: Sun, 17 Feb 2019 12:13:34 +0100 Subject: [PATCH] Build: Use unannotated Git tags as version numbers If a Git tag was created with `git tag $version`, it would not be considered by `git describe`. Add the `--tags` parameter to fix this. See also https://git-scm.com/docs/git-describe. --- .drone.yml | 6 +++--- build.sbt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index b9c30b3..2d4b223 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,9 +7,9 @@ steps: commands: - apk add --no-cache git - git fetch --tags - - git describe - - git describe > SEED - - echo -n $(git describe),latest > .tags + - git describe --tags + - git describe --tags > SEED + - echo -n $(git describe --tags),latest > .tags - name: test image: alpine:3.8 commands: diff --git a/build.sbt b/build.sbt index 714dcab..6e74671 100644 --- a/build.sbt +++ b/build.sbt @@ -8,7 +8,7 @@ def parseVersion(file: Path): Option[String] = .find(_.nonEmpty).map(_.trim) def seedVersion = parseVersion(Paths.get("SEED")) // CI - .getOrElse(Seq("git", "describe").!!.trim) // Local development + .getOrElse(Seq("git", "describe", "--tags").!!.trim) // Local development def bloopVersion = parseVersion(Paths.get("BLOOP")).get def bloopCoursierVersion = parseVersion(Paths.get("COURSIER")).get