/sbt-release

Primary LanguageScalaMIT LicenseMIT

sbt-release

A simple SBT plugin for making git releases.

The release process consists of the following steps:

  • Strip -SNAPSHOT from the version, commit and tag
  • Bump version number and append -SNAPSHOT, commit
  • Push the changes

Usage

In your project, run

sbt release

and then follow the onscreen instructions.

Installation

Add the following to project/plugins.sbt:

addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.20.0")

addSbtPlugin("com.audienceproject.sbt" % "sbt-release" % "<VERSION>")

Configuration

sbt-release aims to have sane defaults and therefor only provides a very limited set of configuration options, which are documented below.

You can find the default values in ReleasePlugin.Defaults.

Changing message templates

sbt-release uses a number of different message templates during the release process. The templates can be changed by using a simple template string with a single string placeholder (%s) for the version number:

// Used when bumping version number and committing the changes
release / commitMsgReleaseTemplate := "🎉 Release version %s 🎉"
release / commitMsgDevCycleTemplate := "👷 🏗 Prepare for dev cycle %s"

// Used during tag creation
release / tagNameTemplate := "release/%s"
release / tagMessageTemplate := "Release %s"

Changing version file name

By default, sbt-release keeps track of the project version number in a file called version.sbt.

This file should be considered as owned by sbt-release, and should not be modified manually unless to bump the major or minor version number. The file is overwritten during the release process.

If, for some reason, you wish to store the project version number in another file, update build.sbt like so:

release / versionSbtFile := baseDirectory.value / "my_version_file.sbt"