scalasbtsbt-release

Specify a custom git tag with sbt-release


Is it possible to specify a git scheme for git tag names with sbt-release?

The tag commit message and comment can be specified. Per the README:

releaseTagComment := s"Releasing ${(version in ThisBuild).value}", releaseCommitMessage := s"Setting version to ${(version in ThisBuild).value}",

But I've been unable to find a way to change the default for the actual tag text, which is set to s"v${releaseVersion}".

I'd like to specify the project name in the tag string, e.g., "myproject-v0.1.1"

To clarify, by the "tag string", I mean the string you see in e.g., git tag -l

We have multiple projects in the same git repository, and they have similar version numbers, so tags like "v0.1.0" are ambiguous.


Solution

  • there's an sbt-release configuration value releaseTagName which you can modify to customize how release tag is generated. This is working for me:

    lazy val root = (project in file(".")).
      settings(
        .... other settings ....
        releaseTagName := s"version-${if (releaseUseGlobalVersion.value) (version in ThisBuild).value else version.value}",
        ....
        )
    

    If everything else fails you can also customize release steps, and write your own tagRelease step.