image: python:3.7
stages:
- test
- deploy
tests:
stage: test
script:
- pip install .[dev]
- pytest --cov=usda
- codecov
- flake8
deploy-pypi:
stage: deploy
when: manual
only:
- master@Lucidiot/python-usda
environment:
name: pypi
url: https://pypi.org/project/python-usda
before_script:
- pip install twine setuptools wheel
- echo "[distutils]" > ~/.pypirc
- echo "index-servers =" >> ~/.pypirc
- echo " pypi" >> ~/.pypirc
- echo "[pypi]" >> ~/.pypirc
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc
- echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc
- python setup.py sdist bdist_wheel
- twine upload dist/* -r pypi
deploy-testpypi:
- branches@Lucidiot/pyurbantz
name: testpypi
url: https://test.pypi.org/project/python-usda
- echo " testpypi" >> ~/.pypirc
- echo "[testpypi]" >> ~/.pypirc
- echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc
- twine upload dist/* -r testpypi