2023-11-15 17:42:35 +01:00
|
|
|
image: python:latest
|
|
|
|
|
|
|
|
variables:
|
|
|
|
PIP_CACHE_DIR: ${CI_PROJECT_DIR}/.cache/pip
|
|
|
|
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- ${PIP_CACHE_DIR}
|
|
|
|
|
|
|
|
before_script:
|
|
|
|
- python --version ; pip --version
|
|
|
|
- pip install virtualenv
|
|
|
|
- virtualenv venv
|
|
|
|
- source venv/bin/activate
|
|
|
|
|
|
|
|
pre-commit:
|
|
|
|
variables:
|
|
|
|
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- ${PRE_COMMIT_HOME}
|
|
|
|
script:
|
|
|
|
- pip install pre-commit
|
|
|
|
- pre-commit run --all-files
|
|
|
|
|
2023-11-15 20:58:00 +01:00
|
|
|
publish:
|
|
|
|
variables:
|
|
|
|
TWINE_PASSWORD: ${CI_JOB_TOKEN}
|
|
|
|
TWINE_USERNAME: gitlab-ci-token
|
|
|
|
TWINE_REPOSITORY_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
|
|
|
|
TWINE_NON_INTERACTIVE: 1
|
|
|
|
when: manual # gentoolkit as a dependency blocks publishing for now
|
|
|
|
script:
|
|
|
|
- pip install build twine
|
|
|
|
- python -m build
|
|
|
|
- python -m twine upload --verbose dist/*
|