trigger: branches: include: - master - releases/* - refs/tags/* - refs/heads/* jobs: - job: Windows pool: vmImage: 'VS2017-Win2016' strategy: maxParallel: 2 matrix: Python36: PYTHON_VERSION: '3.6' PYTHON_ARCH: 'x64' RUSTUP_TOOLCHAIN: nightly TEST_MODE: fast BITS: 64 Python37: PYTHON_VERSION: '3.7' RUSTUP_TOOLCHAIN: nightly PYTHON_ARCH: 'x64' TEST_MODE: fast BITS: 64 steps: - task: UsePythonVersion@0 inputs: versionSpec: '$(PYTHON_VERSION)' addToPath: true architecture: '$(PYTHON_ARCH)' - script: | curl -sSf -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN% set PATH=%PATH%;%USERPROFILE%\.cargo\bin echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" displayName: Install rust (windows) - script: cargo test --verbose displayName: 'Cargo Test' - script: | cargo clean pip install setuptools-rust setuptools pytest wheel python setup.py test displayName: "Python Test" - script: | cargo clean pip install twine python setup.py build_ext python -m pip -v wheel . -w .\\dist dir dist displayName: "Build wheels" - task: DownloadSecureFile@1 inputs: secureFile: .pypirc - script: 'twine upload --config-file $(Agent.TempDirectory)\.pypirc --skip-existing .\\dist\*' displayName: "Publish to PyPI" condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/')) - job: Linux pool: vmImage: 'Ubuntu 16.04' strategy: maxParallel: 2 matrix: Python36: PYTHON_VERSION: '3.6' RUSTUP_TOOLCHAIN: nightly TEST_MODE: fast Python37: PYTHON_VERSION: '3.7' RUSTUP_TOOLCHAIN: nightly TEST_MODE: fast steps: - task: UsePythonVersion@0 inputs: versionSpec: '$(PYTHON_VERSION)' addToPath: true - script: | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $(RUSTUP_TOOLCHAIN) export PATH=$PATH:$HOME/.cargo/bin displayName: 'Install rustc' - script: | export PATH=$PATH:$HOME/.cargo/bin cargo test --verbose displayName: 'Cargo Test' - script: | export PATH=$PATH:$HOME/.cargo/bin cargo clean pip install setuptools-rust setuptools pytest wheel==0.31.1 python setup.py test displayName: "Python Test" - script: | export PATH=$PATH:$HOME/.cargo/bin pip install twine cargo clean docker run --rm -v `pwd`:/io quay.io/pypa/manylinux1_x86_64 bash /io/build-wheels.sh displayName: "Build wheels" - task: DownloadSecureFile@1 inputs: secureFile: .pypirc - task: TwineAuthenticate@0 inputs: artifactFeeds: 'https://pypi.org/' - script: 'twine upload --config-file $(Agent.TempDirectory)/.pypirc --skip-existing ./dist/*-manylinux*.whl' displayName: "Publish to PyPI" condition: and(succeeded(), contains(variables['Build.SourceBranch'], 'refs/tags/'))