-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
137 lines (130 loc) · 3.9 KB
/
azure-pipelines.yml
File metadata and controls
137 lines (130 loc) · 3.9 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# Taken from https://github.com/cloudflare/wrangler/blob/master/azure-pipelines.yml
trigger:
- main
- refs/tags/*
jobs:
- job: test_lint
displayName: "Run tests, fmt, and clippy"
pool:
vmImage: ubuntu-latest
steps:
- template: ci/azure-install-rust.yml
- script: cargo test --locked
displayName: "cargo test --locked"
- script: cargo fmt --all -- --check
displayName: "cargo fmt"
- script: cargo clippy
displayName: "cargo clippy"
- job: test_lint_windows
displayName: "Run tests (Windows)"
pool:
vmImage: windows-latest
steps:
- template: ci/azure-install-rust.yml
- script: cargo test --locked
displayName: "cargo test --locked"
- job: test_lint_nightly
displayName: "Run tests (nightly)"
pool:
vmImage: ubuntu-latest
steps:
- template: ci/azure-install-rust.yml
parameters:
toolchain: nightly
- script: cargo test --locked
displayName: "cargo test --locked"
- job: dist_linux
displayName: "Dist Linux binary"
pool:
vmImage: ubuntu-latest
steps:
- template: ci/azure-install-rust.yml
- script: ./ci/install.sh
- template: ci/azure-collect-binaries.yml
parameters:
name: dist_linux
- job: dist_darwin
displayName: "Dist Darwin binary"
pool:
vmImage: macOS-latest
steps:
- template: ci/azure-install-rust.yml
- script: ./ci/install.sh
env:
MACOSX_DEPLOYMENT_TARGET: 10.7
- template: ci/azure-collect-binaries.yml
parameters:
name: dist_darwin
- job: dist_windows
displayName: "Dist Windows binary"
pool:
vmImage: windows-latest
steps:
- template: ci/azure-install-rust.yml
- bash: ./ci/install.sh
env:
RUSTFLAGS: -Ctarget-feature=+crt-static
- template: ci/azure-collect-binaries.yml
parameters:
name: dist_windows
- job: deploy
dependsOn:
- dist_linux
- dist_darwin
- dist_windows
displayName: "Deploy release binaries"
pool:
vmImage: ubuntu-latest
steps:
- task: DownloadPipelineArtifact@0
displayName: "Download dist - windows"
inputs:
artifactName: dist_windows
targetPath: tmp/windows
- task: DownloadPipelineArtifact@0
displayName: "Download dist - linux"
inputs:
artifactName: dist_linux
targetPath: tmp/linux
- task: DownloadPipelineArtifact@0
displayName: "Download dist - darwin"
inputs:
artifactName: dist_darwin
targetPath: tmp/darwin
- script: |
set -ex
mkdir -p gh-release
find .
tag=`git describe --tags`
mk() {
target=$1
src=$2
for binary in $(find tmp/$src -type f); do
chmod +x $binary
name=$(basename $binary .exe)-$tag-$target
find .
mkdir -p tmp/$name
cp README.md \
LICENSE-MIT \
LICENSE-APACHE \
$binary \
tmp/$name
tar czvf gh-release/$name.tar.gz -C tmp $name
done
}
mk x86_64-unknown-linux-gnu linux
mk x86_64-apple-darwin darwin
mk x86_64-pc-windows-msvc windows
displayName: "prepare the github releases tarball artifacts"
- task: PublishPipelineArtifact@0
displayName: "publish gh_release artifact"
inputs:
artifactName: gh_release
targetPath: gh-release
- task: GithubRelease@0
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
displayName: "Create GitHub Release"
inputs:
gitHubConnection: github-token
repositoryName: jaysonsantos/cli-utils-rs
assets: gh-release/*.tar.gz