1- pool :
2- vmImage : ' ubuntu-16.04'
1+ trigger :
2+ branches :
3+ include : ['*']
4+ tags :
5+ include : ['*']
36
4- strategy :
5- matrix :
6- stable :
7- rustup_toolchain : stable
8- beta :
9- rustup_toolchain : beta
7+ jobs :
8+ - job : ' CI'
9+ strategy :
10+ matrix :
11+ linux-stable :
12+ rustup_toolchain : stable
13+ image_name : ' ubuntu-16.04'
14+ linux-beta :
15+ rustup_toolchain : beta
16+ image_name : ' ubuntu-16.04'
17+ windows-stable :
18+ rustup_toolchain : stable
19+ image_name : ' windows-latest'
20+ # windows-beta:
21+ # rustup_toolchain: beta-gnu
22+ # image_name: 'windows-latest'
23+ # apple-stable:
24+ # rustup_toolchain: stable
25+ # image_name: 'macOS-10.13'
26+ # apple-beta:
27+ # rustup_toolchain: beta
28+ # image_name: 'macos-latest'
1029
11- steps :
12- - script : export CARGO_MAKE_RUN_CODECOV="true" && export CODECOV_TOKEN=$(CODECOV_TOKEN) && export RUSTFLAGS="-C link-dead-code"
13- displayName : Set up environment variables
30+ pool :
31+ vmImage : $(image_name)
1432
15- - script : |
16- curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
17- echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
18- displayName: Install Rust
33+ steps :
34+ - script : export CARGO_MAKE_RUN_CODECOV="true" && export CODECOV_TOKEN=$(CODECOV_TOKEN) && export RUSTFLAGS="-C link-dead-code"
35+ displayName : Set up environment variables
36+ condition : ne( variables['Agent.OS'], 'Windows_NT' )
1937
20- - script : cargo install --debug cargo-make
21- displayName : Install cargo-make
38+ - script : |
39+ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
40+ echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
41+ displayName: Install Rust
42+ condition: ne( variables['Agent.OS'], 'Windows_NT' )
2243
23- - script : RUSTFLAGS="-C link-dead-code" cargo build
24- displayName : Build
44+ - script : |
45+ curl -sSf -o rustup-init.exe https://win.rustup.rs
46+ rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
47+ echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
48+ displayName: Install Rust
49+ condition: eq( variables['Agent.OS'], 'Windows_NT' )
2550
26- - script : RUSTFLAGS="-C link-dead-code" cargo test
27- displayName : Test
51+ - script : RUSTFLAGS="-C link-dead-code" cargo build
52+ displayName : Build
53+ condition : ne( variables['Agent.OS'], 'Windows_NT' )
2854
29- - script : RUSTFLAGS="-C link-dead-code" CODECOV_TOKEN=$(CODECOV_TOKEN) cargo make --no-workspace workspace-coverage
30- displayName : Run test coverage
55+ - script : cargo build
56+ displayName : Build
57+ condition : eq( variables['Agent.OS'], 'Windows_NT' )
3158
32- - script : rustup component add rustfmt
33- displayName : Install rustfmt
59+ - script : RUSTFLAGS="-C link-dead-code" cargo test
60+ displayName : Test
61+ condition : ne( variables['Agent.OS'], 'Windows_NT' )
3462
35- - script : cargo fmt -- --check
36- displayName : Verify formatting
63+ - script : cargo test
64+ displayName : Test
65+ condition : eq( variables['Agent.OS'], 'Windows_NT' )
3766
38- - script : rustup component add clippy
39- displayName : Install clippy
67+ # The following steps are not platform-dependent,
68+ # so we only have to run them on Linux.
4069
41- - script : cargo clippy --all-targets --all-features -- -D warnings
42- displayName : Run clippy
70+ - script : cargo install --debug cargo-make
71+ displayName : Install cargo-make
72+ condition : eq( variables['Agent.OS'], 'Linux' )
73+
74+ - script : RUSTFLAGS="-C link-dead-code" CODECOV_TOKEN=$(CODECOV_TOKEN) cargo make --no-workspace workspace-coverage
75+ displayName : Run test coverage
76+ condition : eq( variables['Agent.OS'], 'Linux' )
77+
78+ - script : rustup component add rustfmt
79+ displayName : Install rustfmt
80+ condition : eq( variables['Agent.OS'], 'Linux' )
81+
82+ - script : cargo fmt -- --check
83+ displayName : Verify formatting
84+ condition : eq( variables['Agent.OS'], 'Linux' )
85+
86+ - script : rustup component add clippy
87+ displayName : Install clippy
88+ condition : eq( variables['Agent.OS'], 'Linux' )
89+
90+ - script : cargo clippy --all-targets --all-features -- -D warnings
91+ displayName : Run clippy
92+ condition : eq( variables['Agent.OS'], 'Linux' )
93+
94+ - job : ' Publish'
95+ condition : startsWith(variables['Build.SourceBranch'], 'refs/tags/')
96+ strategy :
97+ matrix :
98+ linux :
99+ image_name : ' ubuntu-16.04'
100+ platform : ' linux'
101+ windows :
102+ image_name : ' windows-latest'
103+ platform : ' windows'
104+ # macos:
105+ # image_name: 'macOS-10.13'
106+ # platform: 'macos'
107+
108+ pool :
109+ image : $(image_name)
110+
111+ steps :
112+ - bash : |
113+ TAG="$(Build.SourceBranch)"
114+ TAG=${TAG#refs/tags/}
115+ echo TAG
116+ echo "##vso[task.setvariable variable=build.TAG]TAG"
117+ displayName: "Create tag variable"
118+
119+ - script : |
120+ curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain $RUSTUP_TOOLCHAIN
121+ echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
122+ displayName: Install Rust
123+ condition: ne( variables['Agent.OS'], 'Windows_NT' )
124+ displayName: Install Rust
125+
126+ - script : |
127+ curl -sSf -o rustup-init.exe https://win.rustup.rs
128+ rustup-init.exe -y --default-toolchain %RUSTUP_TOOLCHAIN%
129+ echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
130+ displayName: Install Rust
131+ condition: eq( variables['Agent.OS'], 'Windows_NT' )
132+
133+ - script : cargo build --release
134+ displayName : Build
135+
136+ - script : cargo test --release
137+ displayName : Test
138+
139+ - task : CopyFiles@2
140+ displayName : Copy assets
141+ inputs :
142+ sourceFolder : ' $(Build.SourcesDirectory)/target/release'
143+ contents : feather_server
144+ targetFolder : ' $(Build.BinariesDirectory)/feather'
145+
146+ - task : ArchiveFiles@2
147+ displayName : Gather assets
148+ inputs :
149+ rootFolderOrFile : ' $(Build.BinariesDirectory)/feather'
150+ archiveType : ' tar'
151+ tarCompression : ' gz'
152+ archiveFile : ' $(Build.ArtifactStagingDirectory)/feather-$(build.tag)-$(platform).tar.gz'
153+
154+ - task : GithubRelease@0
155+ condition : succeeded()
156+ inputs :
157+ gitHubConnection : ' caelunshun_pat'
158+ repositoryName : ' caelunshun/feather'
159+ action : ' edit'
160+ target : ' $(build.sourceVersion)'
161+ tagSource : ' manual'
162+ tag : ' $(build.tag)'
163+ assets : ' $(Build.ArtifactStagingDirectory)/feather-$(build.tag)-$(platform).tar.gz'
164+ title : ' $(build.tag)'
165+ assetUploadMode : ' replace'
166+ addChangeLog : false
0 commit comments