diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-10 18:01:22 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-10 18:01:22 -0800 |
commit | 5c55784ba1890616671705446322d45fc36a84bb (patch) | |
tree | de90762c3bb7c77e5779d5973a132a83259aa377 /build.sc | |
parent | 719ff8a6d79093d390b0d5ce7d01755e65fcd484 (diff) | |
download | mill-5c55784ba1890616671705446322d45fc36a84bb.tar.gz mill-5c55784ba1890616671705446322d45fc36a84bb.tar.bz2 mill-5c55784ba1890616671705446322d45fc36a84bb.zip |
remove timestamp from auto-publishing to ensure the artifacts published from the same clean repo have the same version
Diffstat (limited to 'build.sc')
-rwxr-xr-x | build.sc | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -234,8 +234,13 @@ def publishVersion = T.input{ tag match{ case Some(t) => (t, t) case None => - val timestamp = java.time.Instant.now().toString.replaceAll(":|\\.", "-") - ("unstable", timestamp + "-" + gitHead()) + val latestTaggedVersion = %%('git, 'describe, "--abbrev=0", "--tags")(pwd).out.trim + + val commitsSinceLastTag = + %%('git, "rev-list", 'master, "--count")(pwd).out.trim.toInt - + %%('git, "rev-list", latestTaggedVersion, "--count")(pwd).out.trim.toInt + + ("unstable", s"$latestTaggedVersion-$commitsSinceLastTag-${gitHead().take(6)}") } } |