juniper/azure-pipelines.yml
Christian Legnitto 794568e463
Add release automation (#346)
See `RELEASING.md` for directions
2019-05-11 23:51:28 -07:00

105 lines
3.3 KiB
YAML

jobs:
###################################################
# Formatting
###################################################
- job: check_formatting
displayName: Check formatting
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
$HOME/.cargo/bin/cargo fmt -- --check
displayName: Run rustfmt
###################################################
# Book
###################################################
- job: run_book_tests
displayName: Book code example tests
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
$HOME/.cargo/bin/rustup component add rustfmt
displayName: Install stable Rust
- script: |
cd docs/book/tests && $HOME/.cargo/bin/cargo test
displayName: Test book code examples via skeptic
- job: build_book_master
displayName: Build rendered book on master branch and push to Github
pool:
vmImage: ubuntu-16.04
dependsOn: run_book_tests
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
variables:
- group: github-keys
steps:
- task: InstallSSHKey@0
inputs:
hostName: $(GHSshKnownHosts)
sshPublicKey: $(GHSshPub)
sshKeySecureFile: $(GHSshPriv)
- script: |
./docs/book/ci-build.sh master
###################################################
# Main Builds
###################################################
- template: _build/azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04
- template: _build/azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13
- template: _build/azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016
###################################################
# Releases
###################################################
- job: check_release_automation
displayName: Check release automation
pool:
vmImage: ubuntu-16.04
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
displayName: Install stable Rust
- script: |
_build/cargo-make.sh "0.19.1" "x86_64-unknown-linux-musl"
displayName: Install cargo-make binary
- script: |
$HOME/.cargo/bin/cargo install cargo-release
displayName: Install cargo-release binary
- script: |
git config --local user.name "Release Test Bot"
git config --local user.email "juniper@example.com"
displayName: Set up git
- script: |
RELEASE_LEVEL="minor" "$HOME/.cargo/bin/cargo" make release-dry-run
displayName: Dry run mode
- script: |
RELEASE_LEVEL="minor" "$HOME/.cargo/bin/cargo" make release-local-test
displayName: Local test mode
- script: |
git --no-pager log -p HEAD...HEAD~20
displayName: Echo local changes
- script: |
cargo make workspace-ci-flow --no-workspace
displayName: Make sure build and tests still work