1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-20 03:09:06 +03:00
wezterm/azure-pipelines.yml

185 lines
6.1 KiB
YAML

# vim:et:sw=2:ts=2:
trigger:
branches:
include: ['master']
tags:
include: ['*']
schedules:
- cron: "0 0 * * *"
displayName: Daily build
branches:
include:
- master
jobs:
- job: 'Clippy'
pool:
vmImage: 'ubuntu-16.04'
steps:
- checkout: self
submodules: true
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH"
displayName: Install rust
- script: |
rustup update
displayName: Update rust toolchains
- script: rustup component add clippy
displayName: Install clippy
- script: |
sudo ./get-deps
displayName: Install system dependencies
- script: cargo clippy --all
displayName: Run Clippy
- job: 'Rustfmt'
pool:
vmImage: 'ubuntu-16.04'
steps:
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH"
displayName: Install rust
- script: |
rustup update
displayName: Update rust toolchains
- script: rustup component add rustfmt
displayName: Install Rustfmt
- script: cargo fmt --all -- --check
displayName: Check formatting
- job: 'Test'
# A list of vmImage names can be found at:
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent
strategy:
matrix:
windows-stable:
imageName: 'vs2017-win2016'
rustup_toolchain: stable
mac-stable:
imageName: 'macos-10.14'
rustup_toolchain: stable
linux-stable:
imageName: 'ubuntu-16.04'
rustup_toolchain: stable
linux-beta:
imageName: 'ubuntu-16.04'
rustup_toolchain: beta
linux-nightly:
imageName: 'ubuntu-16.04'
rustup_toolchain: nightly
pool:
vmImage: $(imageName)
steps:
- checkout: self
submodules: true
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH"
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 -yv --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%USERPROFILE%\.cargo\bin;%PATH%"
displayName: Install rust (windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
rustup update
displayName: Update rust toolchains
- script: |
rustc -vV
cargo -vV
displayName: Show installed rust+cargo version
- script: |
sudo ./get-deps
displayName: Install system dependencies
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build --all
displayName: Cargo build
- script: cargo test --all
displayName: Cargo test
- job: 'Package'
strategy:
matrix:
windows-stable:
imageName: 'vs2017-win2016'
rustup_toolchain: stable
mac-stable:
imageName: 'macos-10.14'
rustup_toolchain: stable
linux-stable:
imageName: 'ubuntu-16.04'
rustup_toolchain: stable
pool:
vmImage: $(imageName)
steps:
- checkout: self
submodules: true
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
echo "##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH"
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 -yv --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%USERPROFILE%\.cargo\bin;%PATH%"
displayName: install rust (windows)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: |
rustup update
displayName: Update rust toolchains
- script: |
rustc -vV
cargo -vV
displayName: Show installed rust+cargo version
- script: |
sudo ./get-deps
displayName: Install system dependencies
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build --release --all
displayName: Build in release mode
- bash: ci/deploy.sh
displayName: Packaging
- task: GithubRelease@0
condition: and(succeeded(), ne(variables['BUILD_REASON'], 'Schedule'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: Release from tag
inputs:
gitHubConnection: release
repositoryName: wez/wezterm
action: edit
target: $(build.sourceVersion)
tagSource: manual
tag: $(wezterm.tagname)
assets: |
$(Build.SourcesDirectory)/*.zip
$(Build.SourcesDirectory)/*.deb
title: $(wezterm.tagname)
assetUploadMode: replace
addChangeLog: false
isPreRelease: false
isDraft: false
- task: GithubRelease@0
condition: and(succeeded(), eq(variables['BUILD_REASON'], 'Schedule'))
displayName: Release from nightly build
inputs:
gitHubConnection: release
repositoryName: wez/wezterm
action: edit
target: $(build.sourceVersion)
tagSource: manual
tag: nightly-$(wezterm.tagname)
assets: |
$(Build.SourcesDirectory)/*.zip
$(Build.SourcesDirectory)/*.deb
title: "Nightly Pre-Release: $(wezterm.tagname)"
assetUploadMode: replace
addChangeLog: false
isPreRelease: true
isDraft: false