diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 005f3fa3c6..6cae198a2f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,8 +1,12 @@ # https://docs.microsoft.com/azure/devops/pipelines/languages/python trigger: -- master - + branches: + include: + - master + tags: + include: + - v* jobs: @@ -34,12 +38,5 @@ jobs: dependsOn: 'Test_conda_linux' pool: vmImage: 'ubuntu-latest' - steps: - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.x' - architecture: 'x64' - - - script: python setup.py sdist - displayName: 'Build sdist' + - template: ci/azure/publish.yml diff --git a/ci/azure/conda_linux.yml b/ci/azure/conda_linux.yml index 836c6030e8..56f7442462 100644 --- a/ci/azure/conda_linux.yml +++ b/ci/azure/conda_linux.yml @@ -8,6 +8,8 @@ jobs: vmImage: ${{ parameters.vmImage }} strategy: matrix: + Python35-windows-min: + python.version: '35-min' Python35: python.version: '35' Python36: @@ -34,8 +36,9 @@ jobs: displayName: 'List installed dependencies' - script: | source activate test_env - export NREL_API_KEY=$(nrelApiKey) pytest pvlib --remote-data --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html + env: + NREL_API_KEY: $(nrelApiKey) displayName: 'pytest' - task: PublishTestResults@2 inputs: @@ -48,6 +51,8 @@ jobs: reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov' condition: eq(variables['coverage'], true) - script: | - bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda + bash <(curl https://codecov.io/bash) -t $CODECOV_TOKEN -f coverage.xml -F adder -F subtractor -F conda + env: + CODECOV_TOKEN: $(codecov_token) displayName: 'codecov' condition: eq(variables['coverage'], true) diff --git a/ci/azure/publish.yml b/ci/azure/publish.yml new file mode 100644 index 0000000000..2764818a3e --- /dev/null +++ b/ci/azure/publish.yml @@ -0,0 +1,21 @@ + +steps: + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.x' + architecture: 'x64' + + - script: pip install wheel twine + displayName: 'Install distribution dependencies' + + - script: python setup.py sdist bdist_wheel + displayName: 'Build sdist and wheel' + + - script: | + python -m twine upload dist/* + condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'tags')) + env: + TWINE_USERNAME: '__token__' + TWINE_PASSWORD: $(TEST_PYPI_API_KEY) + TWINE_REPOSITORY_URL: 'https://test.pypi.org/legacy/' + displayName: 'Upload to PyPI'