This repository has been archived by the owner on Mar 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathazure-pipelines.yml
117 lines (110 loc) · 3.38 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
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
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml
trigger:
- master
- refs/tags/*
pool:
vmImage: 'ubuntu-16.04'
jobs:
- job:
displayName: "Tests and linting"
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: dist_linux
displayName: "Dist Linux binary"
steps:
- template: ci/azure-install-rust.yml
- script: |
set -ex
cargo install --path=. --root=installed
- template: ci/azure-collect-binaries.yml
parameters:
name: dist_linux
- job: dist_darwin
displayName: "Dist Darwin binary"
pool:
vmImage: macOS-10.13
steps:
- template: ci/azure-install-rust.yml
- script: cargo install --path=. --root=installed
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: vs2017-win2016
steps:
- template: ci/azure-install-rust.yml
- script: cargo install --path=. --root=installed
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"
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 $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: grover-tech
repositoryName: devsbb/folder-to-s3-rs
assets: gh-release/*.tar.gz