diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e045ccff..db40ee37 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -15,6 +15,7 @@ stages: - checks - tests linux - tests windows + - upload default: services: @@ -210,3 +211,23 @@ documentations: CI_TOX_ENV: docs rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" + +upload-python-registry: + extends: .linux-image + stage: upload + before_script: + - !reference [.linux-image, before_script] + - python -m pip install twine + script: + - CURRENT_DATE=$(date +"%Y%m%d%H%M") + - sed -i "s|[0-9][0-9.]*|&.${CURRENT_DATE}|" VERSION + - python -m pip wheel . -q --no-deps -C--python-tag=py3 -w build + - python -m twine upload --skip-existing + --repository-url https://${CI_SERVER_HOST}:${CI_SERVER_PORT}/api/v4/projects/202/packages/pypi + build/*.whl + rules: + - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + variables: + PYTHON_VERSION: "3.11" + TWINE_PASSWORD: $CI_JOB_TOKEN + TWINE_USERNAME: gitlab-ci-token diff --git a/tox.ini b/tox.ini index b09b4eff..3381e10c 100644 --- a/tox.ini +++ b/tox.ini @@ -18,6 +18,7 @@ extras = test commands= pytest -vvv --ignore=build --html=pytest-report.html \ --junit-xml=pytest-report.xml --self-contained-html \ + --durations=10 \ xdist: -n auto \ cov: --e3-cov-rewrite {envsitepackagesdir} src \ cov: --cov {envsitepackagesdir}/e3/ --cov-branch \