diff --git a/README.md b/README.md index 515ea7e0a..b6735d9b7 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,10 @@ Build: [![codecov](https://codecov.io/gh/aiqm/torchani/branch/master/graph/badge.svg)](https://codecov.io/gh/aiqm/torchani) [![Total alerts](https://img.shields.io/lgtm/alerts/g/aiqm/torchani.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/aiqm/torchani/alerts/) -Deploy: +Deploy (these builds only succeed on tagged commits): [![Build Status](https://zasdfgbnm.visualstudio.com/torchani/_apis/build/status/Deploy%20docs?branchName=master)](https://zasdfgbnm.visualstudio.com/torchani/_build/latest?definitionId=9?branchName=master) +[![Build Status](https://zasdfgbnm.visualstudio.com/torchani/_apis/build/status/Deploy%20PYPI?branchName=master)](https://zasdfgbnm.visualstudio.com/torchani/_build/latest?definitionId=10?branchName=master) TorchANI is a pytorch implementation of ANI. It is currently under alpha release, which means, the API is not stable yet. If you find a bug of TorchANI, or have some feature request, feel free to open an issue on GitHub, or send us a pull request. diff --git a/azure/deploy-docs.yml b/azure/deploy-docs.yml index 0d0d58cae..ffc48df9f 100644 --- a/azure/deploy-docs.yml +++ b/azure/deploy-docs.yml @@ -20,6 +20,9 @@ steps: inputs: versionSpec: '$(python.version)' +- script: 'git describe --exact-match --tags HEAD' + displayName: 'Fail build on non-release commits' + - script: 'azure/install_dependencies.sh && pip install sphinx sphinx_rtd_theme matplotlib pillow sphinx-gallery && pip install .' displayName: 'Install dependencies' diff --git a/azure/deploy-pypi.yml b/azure/deploy-pypi.yml index 63b4a3fa6..3718074bf 100644 --- a/azure/deploy-pypi.yml +++ b/azure/deploy-pypi.yml @@ -8,6 +8,8 @@ trigger: include: - master +pr: none + variables: python.version: '3.7' @@ -18,11 +20,14 @@ steps: inputs: versionSpec: '$(python.version)' -- script: 'azure/install_dependencies.sh && pip install nose coverage' +- script: 'git describe --exact-match --tags HEAD' + displayName: 'Fail build on non-release commits' + +- script: 'azure/install_dependencies.sh && pip install nose coverage twine' displayName: 'Install dependencies' - script: 'python setup.py nosetests' displayName: Unit tests -- script: 'echo TODO: deploy to PYPI' +- script: 'python setup.py sdist && twine upload -u $(pypi_username) -p $(pypi_password) dist/*' displayName: PYPI deploy