Skip to content

Commit

Permalink
Build: Use unannotated Git tags as version numbers
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tindzk committed Feb 17, 2019
1 parent 5f48fa5 commit 1e5676a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1e5676a

Please sign in to comment.