build: add release task
This commit is contained in:
parent
0171b9b1ed
commit
85183180ab
28
tasks.py
Normal file
28
tasks.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# -*- coding: utf-8; -*-
|
||||
"""
|
||||
Tasks for Sideshow
|
||||
"""
|
||||
|
||||
import os
|
||||
import shutil
|
||||
|
||||
from invoke import task
|
||||
|
||||
|
||||
@task
|
||||
def release(c, skip_tests=False):
|
||||
"""
|
||||
Release a new version of Sideshow
|
||||
"""
|
||||
if not skip_tests:
|
||||
c.run('pytest')
|
||||
|
||||
# rebuild pkg
|
||||
if os.path.exists('dist'):
|
||||
shutil.rmtree('dist')
|
||||
if os.path.exists('Sideshow.egg-info'):
|
||||
shutil.rmtree('Sideshow.egg-info')
|
||||
c.run('python -m build --sdist')
|
||||
|
||||
# upload
|
||||
c.run('twine upload dist/*')
|
Loading…
Reference in a new issue