stages:
  - tests
  - build
  - release

python2.7:
  stage: tests
  image: python:2.7
  before_script:
    - pip install -r development_requirements.txt
  script:
   - nosetests --cover-package=pyEchosign --with-coverage

python3.5:
  stage: tests
  image: python:3.5
  before_script:
    - pip install -r development_requirements.txt
  script:
   - nosetests --cover-package=pyEchosign --with-coverage

python3.6:
  stage: tests
  image: python:3.6
  before_script:
    - pip install -r development_requirements.txt
  script:
   - nosetests --cover-package=pyEchosign --with-coverage

build:
  stage: build
  image: python:3.6
  script:
    - python setup.py bdist_wheel --universal
    - python setup.py sdist
  artifacts:
    paths:
    - dist/
  only:
    - tags

release:
  stage: release
  image: python:3.6
  before_script:
    - pip install twine
  script:
    - twine upload -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/*
  dependencies:
    - build
  only:
    - tags
stages:
  - tests
  - build
  - release

python2.7:
  stage: tests
  image: python:2.7
  before_script:
    - pip install -r development_requirements.txt
  script:
   - nosetests --cover-package=pyEchosign --with-coverage

python3.5:
  stage: tests
  image: python:3.5
  before_script:
    - pip install -r development_requirements.txt
  script:
   - nosetests --cover-package=pyEchosign --with-coverage

python3.6:
  stage: tests
  image: python:3.6
  before_script:
    - pip install -r development_requirements.txt
  script:
   - nosetests --cover-package=pyEchosign --with-coverage

build:
  stage: build
  image: python:3.6
  script:
    - python setup.py bdist_wheel --universal
    - python setup.py sdist
  artifacts:
    paths:
    - dist/
  only:
    - tags

release:
  stage: release
  image: python:3.6
  before_script:
    - pip install twine
    - echo "[server-login]" >> ~/.pypirc
    - echo "username=" ${$TWINE_USERNAME} >> ~/.pypirc
    - echo "password=" ${$TWINE_PASSWORD} >> ~/.pypirc
  script:
    - twine upload dist/*
  dependencies:
    - build
  only:
    - tags
Create pypi config file in Gitlab CI
Create pypi config file in Gitlab CI
