image: python:3.5
before_script:
  - pip install tox
stages:
  - style
  - test

flake8:
  stage: style
  script:
    - tox -e flake8

imports:
  stage: style
  script:
    - tox -e isort

py35:
  stage: test
  script:
    - echo -e $AFIP_TEST_KEY > testapp/test.key
    - echo -e $AFIP_TEST_CRT > testapp/test.crt
    - tox -e py35

image: python:3.5
before_script:
  - pip install tox
stages:
  - style
  - test
  - deploy

flake8:
  stage: style
  script:
    - tox -e flake8

imports:
  stage: style
  script:
    - tox -e isort

py35:
  stage: test
  script:
    - echo -e $AFIP_TEST_KEY > testapp/test.key
    - echo -e $AFIP_TEST_CRT > testapp/test.crt
    - tox -e py35

pypi:
  stage: deploy
  script:
    - pip install -r requirements.txt twine
    - python setup.py sdist bdist_wheel
    - twine upload -u $PYPI_USER -p $PYPI_PASSWORD dist/*
  only:
    - tags@hobarrera/django-afip

Deploy to PyPI from CI
Deploy to PyPI from CI
