Skip to content

Commit

Permalink
Merge pull request #207 from reactioncommerce/akarshit-fix-release-sc…
Browse files Browse the repository at this point in the history
…ript

fix: version bump calculated correctly
  • Loading branch information
Akarshit authored Aug 25, 2021
2 parents e9ebe64 + baca43b commit e6343d7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ Example:
make init-example-storefront
```

## Migrating from v3.x.x to v4.x.x

Look at the detailed guide [here](docs/migration-guide-v4.md)

## Project Commands

These are the available `make` commands in the `reaction-platform` root directory.
Expand Down
9 changes: 8 additions & 1 deletion release.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,14 @@ def line_prepender(filename, line):
f.write(line + content)

def getBump(commits):
level = 'patch'
for author, commit, pullNumber in commits:
if commit.lower().startswith('feat'):
return 'minor'
## its minor if not already major
if level != 'major':
level = 'minor'
if 'BREAKING CHANGE:' in commit:
return 'major'
return 'patch'

def getVersion(prevVersion, commits):
Expand All @@ -71,6 +76,8 @@ def getVersion(prevVersion, commits):
bump = getBump(commits)
if bump == 'minor':
nextVersion = prevVersion.next_minor()
elif bump == 'major':
nextVersion = prevVersion.next_major()
else:
nextVersion = prevVersion.next_patch()
return str(nextVersion)
Expand Down

0 comments on commit e6343d7

Please sign in to comment.