From 87d84f005af0511863d896a501172993f426afba Mon Sep 17 00:00:00 2001 From: Lance Edgar Date: Sun, 24 Nov 2024 10:35:20 -0600 Subject: [PATCH] build: add release task --- tasks.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tasks.py diff --git a/tasks.py b/tasks.py new file mode 100644 index 0000000..d296ec9 --- /dev/null +++ b/tasks.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8; -*- +""" +Tasks for rattail-demo +""" + +import os +import shutil + +from invoke import task + + +@task +def release(c): + """ + Release a new version of 'rattail-demo' + """ + if os.path.exists('dist'): + shutil.rmtree('dist') + if os.path.exists('rattail_demo.egg-info'): + shutil.rmtree('rattail_demo.egg-info') + + c.run('python -m build --sdist') + c.run('twine upload dist/*')