diff --git a/.circleci/config.yml b/.circleci/config.yml index d3a2a2fb9..ae9ebd1ee 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -249,6 +249,28 @@ jobs: - codecov/upload: file: /tmp/src/coverage/coverage.xml + deploy: + docker: + - image: continuumio/miniconda3 + steps: + - checkout + - run: + name: init .pypirc + command: | + echo -e "[pypi]" >> ~/.pypirc + echo -e "username = $PYPI_USER" >> ~/.pypirc + echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc + - run: + name: create package + command: | + python setup.py sdist + python setup.py bdist_wheel + - run: + name: upload to pypi + command: | + pip install twine + twine upload dist/* + workflows: version: 2.1 build_test: @@ -283,3 +305,11 @@ workflows: - four-echo - five-echo - t2smap + - deploy: + requires: + - merge_coverage + filters: + tags: + only: /[0-9]+\.[0-9]+\.[0-9]+(?:rc)?(?:[0-9]+)? + branches: + ignore: /.*/ diff --git a/docs/contributing.rst b/docs/contributing.rst index b2bfa7fc6..77b6abbd8 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -219,13 +219,12 @@ releasing your own Python projects! #. Create a new release, using the GitHub `guide for creating a release on GitHub`_. `Release-drafter`_ should have already drafted release notes listing all changes since the last release; check to make sure these are correct. - #. Pulling from the ``master`` branch, locally build a new copy of tedana and - `upload it to PyPi`_. We have set up tedana so that releases automatically mint a new DOI with Zenodo; a guide for doing this integration is available `here`_. +We have also set up the repository so that tagged releases automatically deploy +to PyPi (for pip installation). -.. _`upload it to PyPi`: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives .. _`guide for creating a release on GitHub`: https://help.github.com/articles/creating-releases/ .. _`Release-drafter`: https://github.com/apps/release-drafter .. _here: https://guides.github.com/activities/citable-code/