Pre-release

Warning! Pre-release is an experimental feature. The behaviour is likely to change.

Pre-releases can be created when branches are divided to two groups by specifying GSG_RELEASE_BRANCHES environment variable, or the corresponding command line option --release-branches.

GSG_RELEASE_BRANCHES takes a list of branch names. Those branches will produce basic semantic release versions, like v1.2.3. All other branches will produce pre-release versions, eg. v2.0.0-alpha.1.

Customize version scheme

The form of the pre-release can be customized by specifying templates for the pre-release version and build metadata. Both options accept comma separated lists of identifier templates:

Option CLI flag Environment variable
pre-release template --pre-tmpl GSG_PRE_TMPL
build metadata template --build-tmpl GSG_BUILD_TMPL

The default value for GSG_PRE_TMPL is

{{ (env "CI_COMMIT_REF_SLUG") }},{{ seq }}

and it will produce versions of form v1.2.3-branchname.1

Templates

Templates are expanded using go text/template.

Available functions:

Function Description
func env(string) string return value of environment variable
func commitTS() time.Time time of the commit being released
func seq() (string, error) generate a sequence number (not available for build metadata)