Skip to content

Commit

Permalink
fix(prerelease): allow making prerelease for bench
Browse files Browse the repository at this point in the history
- fixed the existing funtionality of prerelease

Signed-off-by: Ameya Shenoy <shenoy.ameya@gmail.com>
  • Loading branch information
codingCoffee committed Sep 26, 2018
1 parent 1e8980e commit 0290932
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions bench/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ def bump(bench_path, app, bump_type, from_branch, to_branch, remote, owner, repo
commit_changes(repo_path, new_version, to_branch)
tag_name = create_release(repo_path, new_version, from_branch=from_branch, to_branch=to_branch)
push_release(repo_path, from_branch=from_branch, to_branch=to_branch, remote=remote)
create_github_release(repo_path, tag_name, message, remote=remote, owner=owner, repo_name=repo_name)
prerelease = True if 'beta' in new_version else False
create_github_release(repo_path, tag_name, message, remote=remote, owner=owner, repo_name=repo_name, prerelease=prerelease)
print('Released {tag} for {repo_path}'.format(tag=tag_name, repo_path=repo_path))

def update_branches_and_check_for_changelog(repo_path, from_branch='develop', to_branch='master', remote='upstream'):
Expand Down Expand Up @@ -173,14 +174,13 @@ def get_bumped_version(version, bump_type):
v.prerelease = None

elif bump_type == 'prerelease':
if v.prerelease == None:
if v.prerelease == ():
v.prerelease = ('beta',)

elif len(v.prerelease)==1:
v.prerelease[1] = '1'

if len(v.prerelease)==1:
v.prerelease = ('beta', '1')
else:
v.prerelease[1] = str(int(v.prerelease[1]) + 1)
v.prerelease = ('beta', str(int(v.prerelease[1]) + 1))

return str(v)

Expand Down Expand Up @@ -290,7 +290,7 @@ def push_release(repo_path, from_branch='develop', to_branch='master', remote='u
print(g.push(remote, *args))

def create_github_release(repo_path, tag_name, message, remote='upstream', owner='frappe', repo_name=None,
gh_username=None, gh_password=None):
gh_username=None, gh_password=None, prerelease=False):

print('creating release on github')

Expand All @@ -308,7 +308,7 @@ def create_github_release(repo_path, tag_name, message, remote='upstream', owner
'name': 'Release ' + tag_name,
'body': message,
'draft': False,
'prerelease': False
'prerelease': prerelease
}
for i in range(3):
try:
Expand Down

0 comments on commit 0290932

Please sign in to comment.