From 85183180ab05b6054a9e3ae4567a9320ffe0909c Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Mon, 6 Jan 2025 17:35:31 -0600 Subject: [PATCH] build: add release task --- tasks.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tasks.py diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..6cdbab2 --- /dev/null +++ b/tasks.py @@ -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/*')