diff --git a/ci/version.sc b/ci/version.sc deleted file mode 100644 index c6a44202b7..0000000000 --- a/ci/version.sc +++ /dev/null @@ -1,35 +0,0 @@ -val isMasterCommit = { - sys.env.get("TRAVIS_PULL_REQUEST").contains("false") && - (sys.env.get("TRAVIS_BRANCH").contains("master") || sys.env("TRAVIS_TAG") != "") -} - -def gitHead = - sys.env.get("TRAVIS_COMMIT").getOrElse( - os.proc("git", "rev-parse", "HEAD").call().out.string.trim() - ) - - - -def publishVersion = { - val tag = - try Option( - os.proc("git", "describe", "--exact-match", "--tags", "--always", gitHead).call().out.string.trim() - ) - catch{case e => None} - - val dirtySuffix = os.proc("git", "diff").call().out.string.trim() match{ - case "" => "" - case s => "-DIRTY" + Integer.toHexString(s.hashCode) - } - - tag match{ - case Some(t) => (t, t) - case None => - val latestTaggedVersion = os.proc("git", "describe", "--abbrev=0", "--always", "--tags").call().out.trim - - val commitsSinceLastTag = - os.proc("git", "rev-list", gitHead, "--not", latestTaggedVersion, "--count").call().out.trim.toInt - - (latestTaggedVersion, s"$latestTaggedVersion-$commitsSinceLastTag-${gitHead.take(6)}$dirtySuffix") - } -} diff --git a/docs/build.sc b/docs/build.sc index 5abaf03e73..c5b2f6d971 100644 --- a/docs/build.sc +++ b/docs/build.sc @@ -3,12 +3,18 @@ import $ivy.{`org.pegdown:pegdown:1.6.0`, `com.lihaoyi::scalatags:0.9.4`} import $file.pageStyles, pageStyles._ import $file.pages, pages._ import scalatags.Text.all._ -import $file.^.ci.version import collection.JavaConverters._ import org.pegdown.{PegDownProcessor, ToHtmlSerializer, LinkRenderer, Extensions} import org.pegdown.ast.{VerbatimNode, ExpImageNode, HeaderNode, TextNode, SimpleNode, TableNode} -val (releaseTag, label) = version.publishVersion +val releaseTag = os + .proc( + "git", + "describe", + "--tags", + os.proc("git", "rev-list", "--tags", "--max-count=1").call().out.trim() + ) + .call().out.trim() val postsFolder = os.pwd/'pages