Skip to content

Commit

Permalink
Revise automated release process
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed Mar 24, 2020
1 parent c774135 commit 243acc5
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tasks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@ def release(ctx, type_, repo, prebump="patch"):
"""Make a new release.
"""
version = _read_version()
version = _bump_release(version, type_)
_write_version(version)

if type_:
version = _bump_release(version, type_)
_write_version(version)

ctx.run("towncrier")

ctx.run(f'git commit -am "Release {version}"')

ctx.run(f'git tag -a {version} -m "Version {version}"')

ctx.run(f"python setup.py sdist bdist_wheel")
ctx.run(f"python setup.py egg_info sdist bdist_wheel")

artifacts = list(ROOT.joinpath("dist").glob("resolvelib-*"))
filename_display = "\n".join(f" {a}" for a in artifacts)
Expand All @@ -97,9 +99,12 @@ def release(ctx, type_, repo, prebump="patch"):
return

arg_display = " ".join(f'"{n}"' for n in artifacts)
ctx.run(f'twine upload --repository="{repo}" {arg_display}')

version = _prebump(version, prebump)
_write_version(version)

ctx.run(f'git commit -am "Prebump to {version}"')
if repo:
ctx.run(f'twine upload --repository="{repo}" {arg_display}')
else:
print(f"[release] Skipping upload due to empty repo")

if prebump:
version = _prebump(version, prebump)
_write_version(version)
ctx.run(f'git commit -am "Prebump to {version}"')

0 comments on commit 243acc5

Please sign in to comment.