Skip to content

Commit b794bb6

Browse files
feat: add bumpversion release candidate support
1 parent 5095e42 commit b794bb6

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

.bumpversion.cfg

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,29 @@
11
[bumpversion]
2-
current_version = 9.0.0-rc.1
2+
current_version = 9.0.0
33
commit = True
44
message = Update version numbers from {current_version} -> {new_version}
5+
search = {current_version}
6+
replace = {new_version}
57

6-
[bumpversion:file:gradle.properties]
8+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(?P<rc>\-rc\.\d+)?
9+
serialize =
10+
{major}.{minor}.{patch}{rc}
11+
{major}.{minor}.{patch}
712

13+
[bumpversion:file:gradle.properties]
814
[bumpversion:file:README.md]
9-
1015
[bumpversion:file:assistant/README.md]
11-
1216
[bumpversion:file:compare-comply/README.md]
13-
1417
[bumpversion:file:discovery/README.md]
15-
1618
[bumpversion:file:language-translator/README.md]
17-
1819
[bumpversion:file:natural-language-classifier/README.md]
19-
2020
[bumpversion:file:natural-language-understanding/README.md]
21-
2221
[bumpversion:file:personality-insights/README.md]
23-
2422
[bumpversion:file:speech-to-text/README.md]
25-
2623
[bumpversion:file:text-to-speech/README.md]
27-
2824
[bumpversion:file:tone-analyzer/README.md]
29-
3025
[bumpversion:file:visual-recognition/README.md]
31-
3226
[bumpversion:file:docker/pom.xml]
33-
3427
[bumpversion:file:examples/build.gradle]
35-
search = {current_version}
36-
replace = {new_version}
28+
3729

.releaserc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[
1515
"@semantic-release/exec",
1616
{
17-
"prepareCmd": "bumpversion --current-version ${lastRelease.version} --new-version ${nextRelease.version} --allow-dirty patch"
17+
"prepareCmd": ".utility/bumpversion.sh ${lastRelease.version} ${nextRelease.version}"
1818
}
1919
],
2020
[

.utility/bumpversion.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
VERSION="patch"
6+
7+
if [ "${TRAVIS_BRANCH}" != "master" ]; then
8+
VERSION="rc"
9+
fi
10+
11+
bumpversion --current-version $1 --new-version $2 --allow-dirty $VERSION --verbose

0 commit comments

Comments
 (0)