trigger:
branches:
include: ['*']
tags:
include: ['*']
strategy:
matrix:
windows-stable:
imageName: 'vs2017-win2016'
target: 'x86_64-pc-windows-msvc'
rustup_toolchain: stable
pool:
vmImage: $(imageName)
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install rust (posix)
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
rm rustup-init.exe
displayName: Install rust (windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build --all-features
displayName: Cargo build
- script: cargo test --all-features
displayName: Cargo test
- script: |
cargo publish
displayName: Cargo publish
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
env:
CARGO_REGISTRY_TOKEN: $(crates_io_token)