build: add release task

This commit is contained in:
Lance Edgar 2024-09-10 09:56:30 -05:00
parent 9dfd4b9106
commit 24c93df7cb
2 changed files with 25 additions and 0 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
*~ *~
*.pyc *.pyc
.coverage .coverage
dist/
docs/_build/ docs/_build/

24
tasks.py Normal file
View file

@ -0,0 +1,24 @@
# -*- coding: utf-8; -*-
"""
Tasks for WuttaMess
"""
import os
import shutil
from invoke import task
@task
def release(c, skip_tests=False):
"""
Release a new version of WuttaMess
"""
if not skip_tests:
c.run('pytest')
if os.path.exists('dist'):
shutil.rmtree('dist')
c.run('python -m build --sdist')
c.run('twine upload dist/*')