trigger: branches: include: ['*'] tags: include: ['*'] jobs: - job: displayName: manylinux pool: vmImage: 'ubuntu-18.04' steps: - script: | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" rustup default nightly-x86_64-unknown-linux-gnu cargo --version displayName: "Install Rust" - bash: | MY_TAG="$(Build.SourceBranch)" MY_TAG=${MY_TAG#refs/tags/} echo $MY_TAG echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG" displayName: "Create tag variable" - bash: | DATE="$(date +%Y-%m-%d)" echo "##vso[task.setvariable variable=build.date]$DATE" displayName: "Create date variable" - bash: | cargo install maturin displayName: "Install Maturin" - task: UsePythonVersion@0 inputs: versionSpec: '3.7' architecture: 'x64' - script: | python -m pip install --upgrade pip setuptools wheel displayName: 'Upgrade Python pip' - script: | maturin build -o $(Build.BinariesDirectory) displayName: 'Maturin build' - script: | pip install $(Build.BinariesDirectory)/HPGO-*-cp37-*.whl displayName: 'Install new wheel' - script: | maturin publish -u rongyi -p $(pypi.password) displayName: "Upload to PyPi" condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) - job: displayName: macOS-10.13 pool: vmImage: 'macOS-10.13' steps: - script: | curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain nightly echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin" displayName: "Install Rust" - bash: | MY_TAG="$(Build.SourceBranch)" MY_TAG=${MY_TAG#refs/tags/} echo $MY_TAG echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG" displayName: "Create tag variable" - bash: | DATE="$(date +%Y-%m-%d)" echo "##vso[task.setvariable variable=build.date]$DATE" displayName: "Create date variable" - bash: | cargo install maturin displayName: "Install Maturin" - task: UsePythonVersion@0 inputs: versionSpec: '3.7' architecture: 'x64' - script: | python -m pip install --upgrade pip setuptools wheel displayName: 'Upgrade Python pip' - script: | maturin build -o $(Build.BinariesDirectory) displayName: 'Maturin build' - script: | pip install $(Build.BinariesDirectory)/HPGO-*-cp37-*.whl displayName: 'Install new wheel' - script: | maturin publish -u rongyi -p $(pypi.password) displayName: "Upload to PyPi" condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/')) - job: displayName: Windows pool: vmImage: 'vs2017-win2016' steps: - script: | curl -sSf -o rustup-init.exe https://win.rustup.rs rustup-init.exe -y --default-host x86_64-pc-windows-msvc --default-toolchain nightly echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin" rustup default nightly-x86_64-pc-windows-msvc cargo --version displayName: Install Rust - bash: | MY_TAG="$(Build.SourceBranch)" MY_TAG=${MY_TAG#refs/tags/} echo $MY_TAG echo "##vso[task.setvariable variable=build.my_tag]$MY_TAG" displayName: "Create tag variable" - bash: | DATE="$(date +%Y-%m-%d)" echo "##vso[task.setvariable variable=build.date]$DATE" displayName: "Create date variable" - script: | cargo install maturin displayName: "Install PyO3-pack" - task: UsePythonVersion@0 inputs: versionSpec: '3.7' architecture: 'x64' - script: | python -m pip install --upgrade pip setuptools wheel displayName: 'Install maturin' - script: | maturin build -o $(Build.BinariesDirectory) --interpreter python displayName: 'PyO3-pack build' - powershell: | pip install $(Build.BinariesDirectory)/$(Get-ChildItem $(Build.BinariesDirectory)/HPGO-*-cp37-*.whl | Select -exp Name) displayName: 'Install new wheel' - script: | maturin publish -u rongyi -p $(pypi.password) --interpreter python displayName: "Upload to PyPi" condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))