From b93e1b08f0d45f71d7fdeec825c20cec47def0bb Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Fri, 26 Apr 2019 16:07:44 -0400 Subject: [PATCH 01/11] Add automated releases to Sonatype Nexus through CI --- .circleci/config.yml | 66 +++++++++++++++--- build.sbt | 141 ++++++++++++++++++++++++++------------- project/build.properties | 2 +- project/plugins.sbt | 29 +++----- scripts/cipublish | 27 ++++++++ scripts/test | 2 +- version.sbt | 1 - 7 files changed, 189 insertions(+), 79 deletions(-) create mode 100755 scripts/cipublish delete mode 100644 version.sbt diff --git a/.circleci/config.yml b/.circleci/config.yml index 09a3e4fc..aa2cc392 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,9 +1,9 @@ aliases: - &restore_sbt_cache - key: sbt-{{ checksum "/tmp/scala_version" }}-cache + key: sbt-cache-{{ checksum "/tmp/scala_version" }} - &save_sbt_cache - key: sbt-{{ checksum "/tmp/scala_version" }}-cache-{{ epoch }} + key: sbt-cache-{{ checksum "/tmp/scala_version" }}-{{ epoch }} paths: - "~/.ivy2/cache" - "~/.sbt" @@ -18,6 +18,34 @@ aliases: command: ./scripts/cibuild - save_cache: *save_sbt_cache + - &run_cipublish + - checkout + - run: echo "${SCALA_VERSION}" > /tmp/scala_version + - restore_cache: *restore_sbt_cache + - run: + name: "Import signing key" + command: | + echo "${GPG_KEY}" | base64 -d > signing_key.asc && \ + gpg --batch \ + --passphrase "${GPG_PASSPHRASE}" \ + --import signing_key.asc + - run: + name: Executing cipublish + command: ./scripts/cipublish + + # Build environments + - &openjdk8-scala2_11_12-nodelts_environment + docker: + - image: circleci/openjdk:8-stretch-node + environment: + SCALA_VERSION: 2.11.12 + + - &openjdk8-scala2_12_8-nodelts_environment + docker: + - image: circleci/openjdk:8-stretch-node + environment: + SCALA_VERSION: 2.12.8 + version: 2 workflows: version: 2 @@ -25,18 +53,36 @@ workflows: jobs: - "openjdk8-scala2.11.12-nodelts" - "openjdk8-scala2.12.8-nodelts" + - "openjdk8-scala2.11.12-nodelts_deploy": + requires: + - "openjdk8-scala2.11.12-nodelts" + filters: + branches: + only: + - develop + - master + - "openjdk8-scala2.12.8-nodelts_deploy": + requires: + - "openjdk8-scala2.12.8-nodelts" + filters: + branches: + only: + - develop + - master jobs: "openjdk8-scala2.11.12-nodelts": - docker: - - image: circleci/openjdk:8-stretch-node - environment: - SCALA_VERSION: 2.11.12 + <<: *openjdk8-scala2_11_12-nodelts_environment steps: *run_cibuild "openjdk8-scala2.12.8-nodelts": - docker: - - image: circleci/openjdk:8-stretch-node - environment: - SCALA_VERSION: 2.12.8 + <<: *openjdk8-scala2_12_8-nodelts_environment steps: *run_cibuild + + "openjdk8-scala2.11.12-nodelts_deploy": + <<: *openjdk8-scala2_11_12-nodelts_environment + steps: *run_cipublish + + "openjdk8-scala2.12.8-nodelts_deploy": + <<: *openjdk8-scala2_12_8-nodelts_environment + steps: *run_cipublish diff --git a/build.sbt b/build.sbt index 016506ce..acf2cf8b 100644 --- a/build.sbt +++ b/build.sbt @@ -1,22 +1,105 @@ +import xerial.sbt.Sonatype._ + import com.scalapenos.sbt.prompt.SbtPrompt.autoImport._ promptTheme := com.scalapenos.sbt.prompt.PromptThemes.ScalapenosTheme -/** Project configurations */ +val commonSettings = Seq( + // sbt-git provides the isSnapshot.value variable, which will return true if there + // are no tags associated with the HEAD commit, or if there are uncommitted + // changes. However, sbt-git only appends the -SNAPSHOT suffix if there are + // uncommitted changes in the workspace. + // + // https://github.com/sbt/sbt-git/blob/f8caf9365be380cf101e9605af159b5e7f842d0c/src/main/scala/com/typesafe/sbt/SbtGit.scala#L173 + version := { + // Avoid Cyclic reference involving error + if (git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value) + git.gitDescribedVersion.value.get + "-SNAPSHOT" + else + git.gitDescribedVersion.value.get + }, + scalaVersion := "2.11.12", + crossScalaVersions := Seq("2.11.12", "2.12.8"), + resolvers ++= Seq( + Resolver.sonatypeRepo("releases"), + "locationtech-releases" at "https://repo.locationtech.org/content/groups/releases", + "locationtech-snapshots" at "https://repo.locationtech.org/content/groups/snapshots" + ), + addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full), + scalacOptions := Seq( + "-deprecation", + "-unchecked", + "-feature", + "-language:implicitConversions", + "-language:reflectiveCalls", + "-language:higherKinds", + "-language:postfixOps", + "-language:existentials", + "-language:experimental.macros", + "-feature", + "-Ypatmat-exhaust-depth", "100" + ) +) + +lazy val noPublishSettings = Seq( + publish := {}, + publishLocal := {}, + publishArtifact := false +) + +lazy val publishSettings = Seq( + organization := "com.azavea.geotrellis", + organizationName := "GeoTrellis", + organizationHomepage := Some(new URL("https://geotrellis.io/")), + description := "MAML is used to create a declarative structure that describes a combination of map algebra operations.", + publishArtifact in Test := false +) ++ sonatypeSettings ++ credentialSettings + +lazy val sonatypeSettings = Seq( + publishMavenStyle := true, + + sonatypeProfileName := "com.azavea", + sonatypeProjectHosting := Some(GitHubHosting(user="geotrellis", repository="maml", email="systems@azavea.com")), + developers := List( + Developer(id = "moradology", name = "Nathan Zimmerman", email = "nzimmerman@azavea.com", url = url("https://github.com/moradology")), + Developer(id = "echeipesh", name = "Eugene Cheipesh", email = "echeipesh@azavea.com", url = url("https://github.com/echeipesh")), + Developer(id = "lossyrob", name = "Rob Emanuele", email = "remanuele@azavea.com", url = url("https://github.com/lossyrob")) + ), + licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")), + + publishTo := sonatypePublishTo.value +) + +lazy val credentialSettings = Seq( + credentials += Credentials( + "GnuPG Key ID", + "gpg", + System.getenv().get("GPG_KEY_ID"), + "ignored" + ), + + credentials += Credentials( + "Sonatype Nexus Repository Manager", + "oss.sonatype.org", + System.getenv().get("SONATYPE_USERNAME"), + System.getenv().get("SONATYPE_PASSWORD") + ) +) + lazy val root = project.in(file(".")) + .settings(commonSettings) + .settings(publishSettings) // these settings are needed to release all aggregated modules under this root module + .settings(noPublishSettings) // this is to exclue the root module itself from being published .aggregate(mamlJs, mamlJvm, mamlSpark) - .settings(commonSettings:_*) - .settings( - licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.txt")) - ).enablePlugins(ScalaJSPlugin) + .enablePlugins(ScalaJSPlugin) val circeVer = "0.11.1" val circeOpticsVer = "0.11.0" val gtVer = "3.0.0-M3" lazy val maml = crossProject.in(file(".")) - .settings(publishSettings:_*) - .settings(commonSettings:_*) + .settings(commonSettings) + .settings(publishSettings) .settings( libraryDependencies ++= Seq( "org.scalacheck" %% "scalacheck" % "1.13.4" % "test", @@ -40,51 +123,13 @@ lazy val maml = crossProject.in(file(".")) lazy val mamlJvm = maml.jvm lazy val mamlJs = maml.js lazy val mamlSpark = project.in(file("spark")) - .dependsOn(mamlJvm) + .settings(commonSettings) + .settings(publishSettings) .settings( libraryDependencies ++= Seq( "org.locationtech.geotrellis" %% "geotrellis-spark-testkit" % gtVer % "test", "org.apache.spark" %% "spark-core" % "2.4.0" % "provided", "org.apache.spark" %% "spark-sql" % "2.4.0" % "provided" ) - ).settings(publishSettings:_*) - .settings(commonSettings:_*) - - -/** Common settings */ -lazy val publishSettings = - Seq( - bintrayOrganization := Some("azavea"), - bintrayRepository := "maven", - bintrayVcsUrl := Some("https://github.com/geotrellis/maml.git"), - publishMavenStyle := true, - publishArtifact in Test := false, - pomIncludeRepository := { _ => false }, - homepage := Some(url("https://geotrellis.github.io/maml")) - ) - -val commonSettings = Seq( - organization := "com.azavea", - licenses += ("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0.txt")), - scalaVersion := "2.11.12", - crossScalaVersions := Seq("2.11.12", "2.12.7"), - resolvers ++= Seq( - Resolver.sonatypeRepo("releases"), - "locationtech-releases" at "https://repo.locationtech.org/content/groups/releases", - "locationtech-snapshots" at "https://repo.locationtech.org/content/groups/snapshots" - ), - addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full), - scalacOptions := Seq( - "-deprecation", - "-unchecked", - "-feature", - "-language:implicitConversions", - "-language:reflectiveCalls", - "-language:higherKinds", - "-language:postfixOps", - "-language:existentials", - "-language:experimental.macros", - "-feature", - "-Ypatmat-exhaust-depth", "100" ) -) + .dependsOn(mamlJvm) diff --git a/project/build.properties b/project/build.properties index c091b86c..c0bab049 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.16 +sbt.version=1.2.8 diff --git a/project/plugins.sbt b/project/plugins.sbt index 75c7a1ca..32d6b1ee 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,28 +1,21 @@ -resolvers ++= Seq( - Classpaths.sbtPluginReleases, - Opts.resolver.sonatypeReleases -) +addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.4.0") -resolvers += Classpaths.typesafeResolver - -addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1") - -addSbtPlugin("com.timushev.sbt" % "sbt-updates" % "0.1.10") - -addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.5") +addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9") addSbtPlugin("net.virtual-void" % "sbt-dependency-graph" % "0.9.2") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.25") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.27") -addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.1.0") +addSbtPlugin("io.spray" % "sbt-revolver" % "0.9.1") -addSbtPlugin("io.spray" % "sbt-revolver" % "0.8.0") +addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.3.19") -addSbtPlugin("com.typesafe.sbt" % "sbt-native-packager" % "1.2.0") - -addSbtPlugin("com.47deg" % "sbt-microsites" % "0.6.1") +addSbtPlugin("com.47deg" % "sbt-microsites" % "0.9.0") addSbtPlugin("com.scalapenos" % "sbt-prompt" % "1.0.2") -addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5") + +addSbtPlugin("io.crashbox" % "sbt-gpg" % "0.2.0") + +addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") diff --git a/scripts/cipublish b/scripts/cipublish new file mode 100755 index 00000000..2de349c4 --- /dev/null +++ b/scripts/cipublish @@ -0,0 +1,27 @@ +#!/bin/bash + +set -e + +if [[ -n "${MAML_DEBUG}" ]]; then + set -x +fi + +function usage() { + echo -n \ + "Usage: $(basename "$0") +Publish artifacts to Sonatype. +" +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + if [[ "${1:-}" == "--help" ]]; then + usage + else + echo "Publishing artifacts to Sonatype" + if [[ -n "${CIRCLE_TAG}" ]]; then + ./sbt -J-Xmx4G "++${SCALA_VERSION:-2.11.12}" publish sonatypeRelease + else + ./sbt -J-Xmx4G "++${SCALA_VERSION:-2.11.12}" publish + fi + fi +fi diff --git a/scripts/test b/scripts/test index 7a14b64f..400d5777 100755 --- a/scripts/test +++ b/scripts/test @@ -18,6 +18,6 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then usage else echo "Executing Scala test suite" - ./sbt "++${SCALA_VERSION:-2.11.12}" test + ./sbt -J-Xmx4G "++${SCALA_VERSION:-2.11.12}" test fi fi diff --git a/version.sbt b/version.sbt deleted file mode 100644 index dfd7e193..00000000 --- a/version.sbt +++ /dev/null @@ -1 +0,0 @@ -version in ThisBuild := "0.3.4-SNAPSHOT" From ed0cbbc8c6954a179fb9e8438f708219b12881e0 Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Tue, 30 Apr 2019 10:09:50 -0400 Subject: [PATCH 02/11] Add GitHub issue template for releases --- .github/ISSUE_TEMPLATE/release.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/release.md diff --git a/.github/ISSUE_TEMPLATE/release.md b/.github/ISSUE_TEMPLATE/release.md new file mode 100644 index 00000000..de05db84 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/release.md @@ -0,0 +1,31 @@ +--- +name: Release +about: When ready to cut a release +title: Release X.Y.Z +labels: release +assignees: '' + +--- + +- [ ] Start a new release branch: +```bash +$ git flow release start X.Y.Z +``` +- [ ] Rotate `CHANGELOG.md` (following [Keep a Changelog](https://keepachangelog.com/) principles) +- [ ] Ensure outstanding changes are committed: +```bash +$ git status # Is the git staging area clean? +$ git add CHANGELOG.md +$ git commit -m "X.Y.Z" +``` +- [ ] Publish the release branch: +```bash +$ git flow release publish X.Y.Z +``` +- [ ] Ensure that CI checks pass +- [ ] Finish and publish the release branch: + - When prompted, keep default commit messages + - Use `X.Y.Z` as the tag message +```bash +$ git flow release finish -p X.Y.Z +``` From a5bab00298446a09e0eac581c26f75c6704265f5 Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Tue, 30 Apr 2019 10:16:18 -0400 Subject: [PATCH 03/11] Temporarily deploy my branch --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index aa2cc392..60589c48 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -61,6 +61,7 @@ workflows: only: - develop - master + - feature/jrb/automated-releases-to-sonatype - "openjdk8-scala2.12.8-nodelts_deploy": requires: - "openjdk8-scala2.12.8-nodelts" @@ -69,6 +70,7 @@ workflows: only: - develop - master + - feature/jrb/automated-releases-to-sonatype jobs: "openjdk8-scala2.11.12-nodelts": From 65151ea2e4e49c4badc6c615901e52639e141e2a Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Tue, 30 Apr 2019 12:17:23 -0400 Subject: [PATCH 04/11] Add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 933be80b..87c9999d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add README [#92](https://github.com/geotrellis/maml/pull/92) - Add STRTA and migrate to CircleCI [#93](https://github.com/geotrellis/maml/pull/93) - Add changelog and pull request template [#96](https://github.com/geotrellis/maml/pull/96) +- Add automated releases to Sonatype Nexus through CI [#98](https://github.com/geotrellis/maml/pull/98) ### Changed - Fixed 2.12 compilation in tests [#95](https://github.com/geotrellis/maml/pull/95) From 968644e7f28734374158cb240d6a98933b2738f4 Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Thu, 2 May 2019 10:05:12 -0400 Subject: [PATCH 05/11] add .jvmopts --- .jvmopts | 1 + scripts/cipublish | 4 ++-- scripts/test | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .jvmopts diff --git a/.jvmopts b/.jvmopts new file mode 100644 index 00000000..2b63e3b2 --- /dev/null +++ b/.jvmopts @@ -0,0 +1 @@ +-J-Xmx4G diff --git a/scripts/cipublish b/scripts/cipublish index 2de349c4..41b73c08 100755 --- a/scripts/cipublish +++ b/scripts/cipublish @@ -19,9 +19,9 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then else echo "Publishing artifacts to Sonatype" if [[ -n "${CIRCLE_TAG}" ]]; then - ./sbt -J-Xmx4G "++${SCALA_VERSION:-2.11.12}" publish sonatypeRelease + ./sbt "++${SCALA_VERSION:-2.11.12}" publish sonatypeRelease else - ./sbt -J-Xmx4G "++${SCALA_VERSION:-2.11.12}" publish + ./sbt "++${SCALA_VERSION:-2.11.12}" publish fi fi fi diff --git a/scripts/test b/scripts/test index 400d5777..7a14b64f 100755 --- a/scripts/test +++ b/scripts/test @@ -18,6 +18,6 @@ if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then usage else echo "Executing Scala test suite" - ./sbt -J-Xmx4G "++${SCALA_VERSION:-2.11.12}" test + ./sbt "++${SCALA_VERSION:-2.11.12}" test fi fi From 35bf99da0163addbd6379b0e529aeb78a29efcfc Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Thu, 2 May 2019 10:06:18 -0400 Subject: [PATCH 06/11] fixup! add .jvmopts --- .jvmopts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.jvmopts b/.jvmopts index 2b63e3b2..56aefe05 100644 --- a/.jvmopts +++ b/.jvmopts @@ -1 +1 @@ --J-Xmx4G +-Xmx4G From 51c3200ec5cae95f8452edd8317cb1986368e4aa Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Thu, 2 May 2019 12:07:53 -0400 Subject: [PATCH 07/11] only build master on tagged commits --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60589c48..6def88ba 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,19 +57,23 @@ workflows: requires: - "openjdk8-scala2.11.12-nodelts" filters: + tags: + only: + - /^(.*)$/ branches: only: - develop - - master - feature/jrb/automated-releases-to-sonatype - "openjdk8-scala2.12.8-nodelts_deploy": requires: - "openjdk8-scala2.12.8-nodelts" filters: + tags: + only: + - /^(.*)$/ branches: only: - develop - - master - feature/jrb/automated-releases-to-sonatype jobs: From 398f7252a1361a8a15ea2dcaf1e06622abab6cd0 Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Thu, 2 May 2019 12:13:51 -0400 Subject: [PATCH 08/11] fixup! only build master on tagged commits --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6def88ba..9d454ef8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -57,7 +57,7 @@ workflows: requires: - "openjdk8-scala2.11.12-nodelts" filters: - tags: + tags: only: - /^(.*)$/ branches: From 957ef206f8fd1fbb5c42e932e20e76a19b3a7ede Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Thu, 2 May 2019 13:14:46 -0400 Subject: [PATCH 09/11] Add master back --- .circleci/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d454ef8..3b9cbbe6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,6 +62,7 @@ workflows: - /^(.*)$/ branches: only: + - master - develop - feature/jrb/automated-releases-to-sonatype - "openjdk8-scala2.12.8-nodelts_deploy": @@ -73,6 +74,7 @@ workflows: - /^(.*)$/ branches: only: + - master - develop - feature/jrb/automated-releases-to-sonatype From c96ae76df23f12603fe90042e6680d4467117881 Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Thu, 2 May 2019 13:22:52 -0400 Subject: [PATCH 10/11] add required tag filters to pass tags to required jobs --- .circleci/config.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b9cbbe6..b26a85e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -51,8 +51,16 @@ workflows: version: 2 build: jobs: - - "openjdk8-scala2.11.12-nodelts" - - "openjdk8-scala2.12.8-nodelts" + - "openjdk8-scala2.11.12-nodelts": + filters: # required since `openjdk8-scala2.11.12-nodelts_deploy` has tag filters AND requires `openjdk8-scala2.11.12-nodelts` + tags: + only: + - /^(.*)$/ + - "openjdk8-scala2.12.8-nodelts": + filters: # required since `openjdk8-scala2.12.8-nodelts_deploy` has tag filters AND requires `openjdk8-scala2.12.8-nodelts` + tags: + only: + - /^(.*)$/ - "openjdk8-scala2.11.12-nodelts_deploy": requires: - "openjdk8-scala2.11.12-nodelts" From 777d546ccafadb26bb0cfe1d60d03c7bd98f92db Mon Sep 17 00:00:00 2001 From: Rocky Breslow Date: Mon, 6 May 2019 09:34:18 -0400 Subject: [PATCH 11/11] update comment about value of version --- build.sbt | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/build.sbt b/build.sbt index acf2cf8b..1f863a86 100644 --- a/build.sbt +++ b/build.sbt @@ -5,12 +5,9 @@ import com.scalapenos.sbt.prompt.SbtPrompt.autoImport._ promptTheme := com.scalapenos.sbt.prompt.PromptThemes.ScalapenosTheme val commonSettings = Seq( - // sbt-git provides the isSnapshot.value variable, which will return true if there - // are no tags associated with the HEAD commit, or if there are uncommitted - // changes. However, sbt-git only appends the -SNAPSHOT suffix if there are - // uncommitted changes in the workspace. - // - // https://github.com/sbt/sbt-git/blob/f8caf9365be380cf101e9605af159b5e7f842d0c/src/main/scala/com/typesafe/sbt/SbtGit.scala#L173 + // We are overriding the default behavior of sbt-git which, by default, + // only appends the `-SNAPSHOT` suffix if there are uncommitted + // changes in the workspace. version := { // Avoid Cyclic reference involving error if (git.gitCurrentTags.value.isEmpty || git.gitUncommittedChanges.value)