-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
47 lines (44 loc) · 1.62 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
trigger:
- master
strategy:
matrix:
windows:
imageName: 'windows-latest'
rustup_toolchain: stable
rust_target: 'x86_64-pc-windows-msvc'
artifact: 'win_x86_64'
mac:
imageName: 'macOS-latest'
rustup_toolchain: stable
rust_target: 'x86_64-apple-darwin'
artifact: 'mac_x86_64'
linux:
imageName: 'ubuntu-latest'
rustup_toolchain: stable
rust_target: 'x86_64-unknown-linux-gnu'
artifact: 'linux_x86_64'
pool:
vmImage: $(imageName)
# https://nbsoftsolutions.com/blog/azure-pipelines-for-rust-projects
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
condition: ne( variables['Agent.OS'], 'Windows_NT' )
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-host %RUST_TARGET% --default-toolchain %RUSTUP_TOOLCHAIN%
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
displayName: Install rust (win)
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- script: cargo build --target $(RUST_TARGET) --release --bin ck3json --
displayName: Compile ck3json
- publish: 'target/$(RUST_TARGET)/release/ck3json'
displayName: 'Publish artifacts'
condition: ne( variables['Agent.OS'], 'Windows_NT' )
artifact: $(artifact)
- publish: 'target\$(RUST_TARGET)\release\ck3json.exe'
displayName: 'Publish artifacts (win)'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
artifact: $(artifact)