---
image: registry.gitlab.com/notno/python-tests

python:twine:
  stage: .post
  variables:
    TWINE_USERNAME: ${CI_REGISTRY_USER}
    TWINE_PASSWORD: ${CI_JOB_TOKEN}
    TWINE_REGISTRY: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
  script:
    - pip install twine build
    - python -m build
    - twine upload --skip-existing --repository-url ${TWINE_REGISTRY} dist/*
  rules:
    - if: ($CI_COMMIT_TAG =~ /^v[0-9]+(\.[0-9]+){2}$/)
