diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a77c59f..590b9c0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,6 +2,7 @@ image: python:3.10 stages: - test + - publish before_script: - python -V @@ -9,9 +10,19 @@ before_script: - source venv/bin/activate - pip install -U pip - pip install . - - echo "[CarbonTracer]" > config.ini - - echo "key = ${API_KEY}" >> config.ini test: stage: test - script: python -m unittest test.py + script: + - echo "[CarbonTracer]" > config.ini + - echo "key = ${API_KEY}" >> config.ini + - python -m unittest test.py + +publish: + stage: publish + script: + - pip install -U hatchling twine build + - python -m build . + - python -m twine upload --username __token__ --password ${PYPI_TOKEN} dist/* + only: + - tags \ No newline at end of file