Skip to main content

Medium configuration example

Here you can find the example of a medium complexity configuration in the supported formats.

This configuration doesn't use any preset but sets many global configuration options explicitly along with commit message conventions and release types. Where allowed, templates are also used.

{
"changelog": {
"path": "CHANGELOG.md",
"sections": {
"Added": "^feat$",
"Fixed": "^fix$"
},
"substitutions": {
"(?m)#([0-9]+)(?s)": "[#%s](https://example.com/issues/%s)"
}
},
"commitMessageConventions": {
"enabled": [
"conventionalCommits"
],
"items": {
"conventionalCommits": {
"expression": "(?m)^(?<type>[a-zA-Z0-9_]+)(\\((?<scope>[a-zA-Z0-9 \\-_]+)\\))?(!)?:( (?<title>.+))$(?s).*",
"bumpExpressions": {
"major": "(?s)(?m)^[a-zA-Z0-9_]+(\\([a-zA-Z0-9 \\-_]+\\))?(!: .*|.*^(BREAKING( |-)CHANGE: )).*",
"minor": "(?s)(?m)^feat(!{0})(\\([a-zA-Z0-9 \\-_]+\\))?: (?!.*^(BREAKING( |-)CHANGE: )).*",
"patch": "(?s)(?m)^fix(!{0})(\\([a-zA-Z0-9 \\-_]+\\))?: (?!.*^(BREAKING( |-)CHANGE: )).*"
}
}
}
},
"dryRun": false,
"git": {
"remotes": {
"origin": {
"authenticationMethod": "USER_PASSWORD",
"user": "jdoe",
"password": "somepassword"
}
}
},
"initialVersion": "0.1.0",
"releaseLenient": true,
"releasePrefix": "v",
"releaseTypes": {
"enabled": [
"mainline",
"internal"
],
"publicationServices": [
"github"
],
"items": {
"mainline": {
"collapseVersions": false,
"filterTags": "^({{configuration.releasePrefix}})?([0-9]\\d*)\\.([0-9]\\d*)\\.([0-9]\\d*)$",
"gitCommit": "true",
"gitCommitMessage": "Release version {{version}}",
"gitPush": "true",
"gitPushForce": "true",
"gitTag": "true",
"gitTagForce": "true",
"gitTagMessage": "Tag release {{version}}",
"gitTagNames": [
"{{version}}",
"stable",
"latest"
],
"matchBranches": "^(master|main)$",
"matchEnvironmentVariables": {
"CI": "^true$"
},
"matchWorkspaceStatus": "CLEAN",
"publish": "true",
"releaseName": "Release {{version}}",
"versionRangeFromBranchName": false
},
"internal": {
"collapseVersions": false,
"collapsedVersionQualifier": "internal",
"description": "Internal release {{version}}",
"filterTags": "^({{configuration.releasePrefix}})?([0-9]\\d*)\\.([0-9]\\d*)\\.([0-9]\\d*)$",
"gitCommit": "false",
"gitPush": "false",
"gitTag": "false",
"identifiers": [
{
"position": "BUILD",
"qualifier": "branch",
"value": "{{#sanitize}}{{branch}}{{/sanitize}}"
},
{
"position": "BUILD",
"qualifier": "commit",
"value": "{{#short7}}{{releaseScope.finalCommit}}{{/short7}}"
},
{
"position": "BUILD",
"qualifier": "user",
"value": "{{#sanitizeLower}}{{environmentUser}}{{/sanitizeLower}}"
},
{
"position": "BUILD",
"qualifier": "timestamp",
"value": "{{#timestampYYYYMMDDHHMMSS}}{{timestamp}}{{/timestampYYYYMMDDHHMMSS}}"
}
],
"publish": "false",
"publishDraft": "true",
"versionRangeFromBranchName": false
}
}
},
"scheme": "SEMVER",
"services": {
"github": {
"type": "GITHUB",
"options": {
"AUTHENTICATION_TOKEN": "{{#environmentVariable}}GITHUB_TOKEN{{/environmentVariable}}",
"REPOSITORY_NAME": "myrepo",
"REPOSITORY_OWNER": "acme"
}
}
},
"substitutions": {
"enabled": [
"npm"
],
"items": {
"npm": {
"files": "package.json",
"match": "\"version\"(\\s)*:(\\s)*\"(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?\"",
"replace": "\"version\": \"{{version}}\""
}
}
},
"verbosity": "INFO"
}

Source code for this file is available here.