From 1defdd271f1e4047b16a22d7c9c127cc5fd42b35 Mon Sep 17 00:00:00 2001 From: Lucidiot Date: Sat, 20 Oct 2018 22:17:23 +0200 Subject: [PATCH] Add deploy jobs to GitLab CI --- .gitlab-ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bdbb638..148ba88 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,11 +1,57 @@ +image: python:3.7-alpine stages: - lint + - deploy -pyurbantz-lint: +flake8: stage: lint - image: python:3.5-alpine before_script: - pip install .[dev] script: - flake8 + +deploy-pypi: + stage: deploy + when: manual + only: + - master@Lucidiot/pyurbantz + environment: + name: pypi + url: https://pypi.org/project/pyurbantz + + 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 + script: + - python setup.py sdist bdist_wheel + - twine upload dist/* -r pypi + +deploy-testpypi: + stage: deploy + when: manual + only: + - branches@Lucidiot/pyurbantz + environment: + name: testpypi + url: https://test.pypi.org/project/pyurbantz + + before_script: + - pip install twine setuptools wheel + - echo "[distutils]" > ~/.pypirc + - echo "index-servers =" >> ~/.pypirc + - echo " testpypi" >> ~/.pypirc + - echo "[testpypi]" >> ~/.pypirc + - echo "repository=https://test.pypi.org/legacy/" >> ~/.pypirc + - echo "username=$PYPI_DEPLOY_USERNAME" >> ~/.pypirc + - echo "password=$PYPI_DEPLOY_PASSWORD" >> ~/.pypirc + script: + - python setup.py sdist bdist_wheel + - twine upload dist/* -r testpypi +