diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ad8ee64072b6850235a9fffdd300dfecfc80c16b..38e6a61b04c8854ea406414358aa6f66df19f444 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -32,3 +32,18 @@ upload: - sed -i "s/v0.0.1-dev/$CI_COMMIT_TAG/g" src/__init__.py - python -m build - python -m twine upload --verbose --repository-url ${PRIVATE_REGISTRY_API_URL} dist/* + + + +upload-to-pypi: + extends: upload + variables: + PRIVATE_REGISTRY_API_URL: "https://pypi.org" + TWINE_PASSWORD: "${PYPI_TOKEN_PASSWORD}" + TWINE_USERNAME: "__token__" + before_script: + - > + if [[ -z "$TWINE_PASSWORD" ]]; then + echo "No token provided, cannot upload" + exit 1 + fi