feat: add .gitlab-ci.yml
This commit is contained in:
parent
27c0d76e16
commit
4e8fb95c52
11
.gitlab-ci.yml
Normal file
11
.gitlab-ci.yml
Normal 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
|
7
tasks.py
7
tasks.py
@ -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}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user