feat: add .gitlab-ci.yml

This commit is contained in:
Georg K 2022-03-30 18:48:10 +03:00
parent 27c0d76e16
commit 4e8fb95c52
2 changed files with 15 additions and 3 deletions

11
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,11 @@
stages:
- package
publish-pypi:
stage: package
image: python:3.8
script:
- pip install -U setuptools wheel pip; pip install invoke
- invoke upload --pypi-user ${PYPI_REPO_USER} --pypi-password ${PYPI_REPO_PASSWORD} --pypi_url ${PYPI_REPO_URL}
only:
- tags

View File

@ -156,7 +156,7 @@ def prepare_upload(c):
@task(tag_eq_version, prepare_upload)
def upload(c, pypi_user=None, pypi_password=None):
def upload(c, pypi_user=None, pypi_password=None, pypi_url=None):
"""
Upload on pypi
"""
@ -165,8 +165,9 @@ def upload(c, pypi_user=None, pypi_password=None):
if pypi_user is not None and pypi_password is not None:
c.run(
f"dist_venv/bin/twine upload --non-interactive"
f" -u {pypi_user} -p {pypi_password} {dist}",
f" -u {pypi_user} -p {pypi_password} {dist}"
f" --repository-url {pypi_url}",
hide=True,
)
else:
c.run(f"dist_venv/bin/twine upload --repository aiohttp-pydantic {dist}")
c.run(f"dist_venv/bin/twine upload --repository-url {pypi_url} --repository aiohttp-pydantic {dist}")