build: add release task

This commit is contained in:
Lance Edgar 2025-01-06 17:35:31 -06:00
parent 0171b9b1ed
commit 85183180ab

28
tasks.py Normal file
View 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/*')