From e350e8c75c16240abb5c555e40b6ec5aa1d55144 Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sat, 20 Nov 2021 15:23:42 +0100 Subject: [PATCH] Improve publish process --- tasks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 25c8811..f5a6843 100644 --- a/tasks.py +++ b/tasks.py @@ -1,3 +1,4 @@ +import os from pathlib import Path from invoke import task @@ -29,5 +30,10 @@ def full_test(ctx): @task def publish(ctx): + username = os.getenv("PYPI_USERNAME") + password = os.getenv("PYPI_TOKEN") 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)