forked from gnunicorn/gather
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathazure-pipeline.yml
More file actions
173 lines (171 loc) · 5.35 KB
/
azure-pipeline.yml
File metadata and controls
173 lines (171 loc) · 5.35 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
trigger:
branches:
include: ['master']
tags:
include: ['v*']
pr:
branches:
include:
- master
paths:
exclude:
- "*.md"
- "docs/*"
- "LICENSE-*"
schedules:
- cron: "12 12 12 * *"
displayName: Monthly Build
branches:
include:
- master
variables:
windows_vm: vs2017-win2016
mac_vm: macos-10.14
linux_vm: ubuntu-16.04
rust_style: stable
crate_name: gather
stages:
- stage: test
displayName: Test
jobs:
- job: test
displayName: Test
strategy:
matrix:
windows:
imageName: ${{ variables.windows_vm }}
target: 'x86_64-pc-windows-msvc'
channel: stable
mac:
imageName: ${{ variables.mac_vm }}
channel: stable
linux:
imageName: ${{ variables.linux_vm }}
channel: stable
linux_beta:
imageName: ${{ variables.linux_vm }}
channel: beta
linux_nightly:
imageName: ${{ variables.linux_vm }}
channel: nightly
continueOnError: ${{ eq(variables.channel, 'nightly') }}
pool:
vmImage: $(imageName)
steps:
- template: azure/install-rust.yml@templates
parameters:
rust: $(channel)
- script: |
choco install llvm
if %ERRORLEVEL% NEQ 0 goto :eof
echo ##vso[task.setvariable variable=PATH]%PATH%;C:\Program Files\LLVM\bin
displayName: 'Install llvm'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: ./scripts/init.sh
displayName: Substrate setup
- script: cargo test --verbose
displayName: Testing
- stage: release
displayName: Release
dependsOn: test
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
jobs:
- job:
strategy:
matrix:
windows:
imageName: ${{ variables.windows_vm }}
target: 'x86_64-pc-windows-msvc'
mac:
imageName: ${{ variables.mac_vm }}
target: 'x86_64-apple-darwin'
linux:
imageName: ${{ variables.linux_vm }}
target: 'x86_64-unknown-linux-gnu'
pool:
vmImage: $(imageName)
timeoutInMinutes: 120
steps:
- template: azure/install-rust.yml@templates
- script: |
choco install llvm
if %ERRORLEVEL% NEQ 0 goto :eof
echo ##vso[task.setvariable variable=PATH]%PATH%;C:\Program Files\LLVM\bin
displayName: 'Install llvm'
condition: eq( variables['Agent.OS'], 'Windows_NT' )
- bash: ./scripts/init.sh
displayName: Substrate setup
- script: |
cargo build --release --bin $(CRATE_NAME)
displayName: Build Release Assets
- task: CopyFiles@2
displayName: Stage wasm runtime
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/release/wbuild/$(crate_name)-runtime/'
contents: '*.compact.wasm'
targetFolder: '$(Build.BinariesDirectory)/'
- task: CopyFiles@2
displayName: Stage assets
condition: ne( variables['Agent.OS'], 'Windows_NT' )
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/release'
contents: $(crate_name)
targetFolder: '$(Build.BinariesDirectory)/'
- task: CopyFiles@2
displayName: Stage assets on Windows
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
sourceFolder: '$(Build.SourcesDirectory)/target/release'
contents: $(crate_name).exe
targetFolder: '$(Build.BinariesDirectory)/'
- task: ArchiveFiles@2
displayName: Tarball assets
condition: ne( variables['Agent.OS'], 'Windows_NT' )
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/'
includeRootFolder: false
archiveType: 'tar'
tarCompression: 'gz'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).tar.gz'
- task: GithubRelease@0
condition: ne( variables['Agent.OS'], 'Windows_NT' )
inputs:
gitHubConnection: 'gnunicorn'
repositoryName: 'gnunicorn/gather'
action: 'edit'
target: '$(build.sourceVersion)'
tagSource: 'manual'
tag: '$(Build.SourceBranchName)'
assets: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).tar.gz'
title: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
- task: ArchiveFiles@2
displayName: Zip assets
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
rootFolderOrFile: '$(Build.BinariesDirectory)/'
includeRootFolder: false
archiveType: 'zip'
archiveFile: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).zip'
- task: GithubRelease@0
condition: eq( variables['Agent.OS'], 'Windows_NT' )
inputs:
gitHubConnection: 'gnunicorn'
repositoryName: 'gnunicorn/gather'
action: 'edit'
target: '$(build.sourceVersion)'
tagSource: 'manual'
tag: '$(Build.SourceBranchName)'
assets: '$(Build.ArtifactStagingDirectory)/$(crate_name)-$(Build.SourceBranchName)-$(TARGET).zip'
title: '$(Build.SourceBranchName)'
assetUploadMode: 'replace'
resources:
repositories:
- repository: templates
type: github
name: crate-ci/azure-pipelines
endpoint: gnunicorn
- repository: gh-install
type: github
name: crate-ci/gh-install
endpoint: gnunicorn