Add requirements file for invoke & update invoke tasks
This commit is contained in:
parent
b2bc5e0d1c
commit
47b6a8b958
2 changed files with 16 additions and 2 deletions
1
requirements.txt
Normal file
1
requirements.txt
Normal file
|
@ -0,0 +1 @@
|
|||
invoke
|
17
tasks.py
17
tasks.py
|
@ -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")
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue