Improve publish process

This commit is contained in:
Gabriel Augendre 2021-11-20 15:23:42 +01:00
parent dba4301eb6
commit e350e8c75c

View file

@ -1,3 +1,4 @@
import os
from pathlib import Path from pathlib import Path
from invoke import task from invoke import task
@ -29,5 +30,10 @@ def full_test(ctx):
@task @task
def publish(ctx): def publish(ctx):
username = os.getenv("PYPI_USERNAME")
password = os.getenv("PYPI_TOKEN")
with ctx.cd(BASE_DIR): with ctx.cd(BASE_DIR):
ctx.run(f"poetry publish --build", pty=True, echo=True) args = ""
if username and password:
args = f"--username {username} --password {password}"
ctx.run(f"poetry publish --build {args}", pty=True, echo=True)