diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a283a23 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,71 @@ +version: 2 +jobs: + build_deploy: &build_deploy + working_directory: ~/neo-boa + docker: + - image: circleci/python:3.6.4 + steps: + - checkout + + - run: + name: Setup Environment + command: | + python3 -m venv venv + source venv/bin/activate + + - run: + name: Install Deps + command: | + pip install -r requirements_dev.txt + + - run: + name: Build .pypirc + command: | + echo -e "[pypi]" >> ~/.pypirc + echo -e "username = $PYPI_USERNAME >> ~/.pypirc + echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + + - run: + name: Build Package + command: | + python3 setup.py sdist bdist_wheel + + - run: + name: Push to TestPyPi + command: + python3 -m twine upload --repository $PYPI_REPO dist/* + build_deploy_test: + <<: *build_deploy + build_deploy_prod: + <<: *build_deploy + + +workflows: + version: 2 + build_deploy: + jobs: + - build_deploy_test: + context: pypy_test + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ + - approve-release: + type: approval + requires: + - build_deploy_test + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ + - build_deploy_prod: + context: pypi_prod + requires: + - approve-release + filters: + tags: + only: /^v.*/ + branches: + ignore: /.*/ \ No newline at end of file