Add requirements file for invoke & update invoke tasks

This commit is contained in:
Gabriel Augendre 2021-08-21 09:25:06 +02:00
parent b2bc5e0d1c
commit 47b6a8b958
2 changed files with 16 additions and 2 deletions

1
requirements.txt Normal file
View file

@ -0,0 +1 @@
invoke

View file

@ -22,10 +22,23 @@ BASE_DIR = Path(__file__).parent.resolve(strict=True)
@task
def tag(context, tag):
def test(context):
"""Run tests"""
context.run("go test ./...")
@task(pre=[test])
def release(context, version_name):
"""Create & push git tag + build binaries"""
tag(context, version_name)
build(context, version_name)
@task(pre=[test])
def tag(context, version_name):
"""Create & push a git tag"""
context: Context
context.run(f"git tag -a {tag} -m '{tag}'")
context.run(f"git tag -a {version_name} -m '{version_name}'")
context.run("git push --follow-tags")