-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-pipelines.yml
226 lines (196 loc) · 7.01 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
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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
variables:
macosSignAndNotarize: false
isReleaseMode: false
trigger:
branches:
include:
- master
- verification
tags:
include:
- '*'
jobs:
- job: 'Build_Windows'
pool:
vmImage: 'windows-2019'
variables:
build_config: RelWithDebInfo
DepsBasePath: 'D:\obsdependencies'
DepsPath32: '$(DepsBasePath)\win32'
DepsPath64: '$(DepsBasePath)\win64'
QtBaseDir: 'D:\QtDep'
QTDIR32: '$(QtBaseDir)\5.10.1\msvc2017'
QTDIR64: '$(QtBaseDir)\5.10.1\msvc2017_64'
OBSPath: 'D:\obs-studio'
steps:
- checkout: self
submodules: true
- script: ./ci/windows/install-choco.cmd
displayName: 'Install Chocolatey'
- script: |
choco install -y llvm
refreshenv
displayName: 'Install LLVM'
- task: Cache@2
displayName: Cargo target cache
inputs:
key: 'rust-target | "$(Agent.OS)"'
restoreKeys: |
rust-target | "$(Agent.OS)"
path: target
- script: |
curl -sSf -o rustup-init.exe https://win.rustup.rs
rustup-init.exe -y --default-toolchain stable
echo "##vso[task.setvariable variable=PATH;]%PATH%;%USERPROFILE%\.cargo\bin"
rustup target add i686-pc-windows-msvc
- script: ./ci/windows/install-qt-win.cmd
displayName: 'Install Qt'
env:
QtBaseDir: $(QtBaseDir)
- task: Cache@2
displayName: Restore cached OBS Studio dependencies
inputs:
key: 'obsdeps | "$(Agent.OS)"'
restoreKeys: |
obsdeps | "$(Agent.OS)"
path: $(DepsBasePath)
- script: ./ci/windows/download-obs-deps.cmd
displayName: 'Download OBS Studio dependencies'
- task: Cache@2
displayName: Restore cached OBS Studio builds
inputs:
key: 'obs | "$(Agent.OS)"'
restoreKeys: |
obs | "$(Agent.OS)"
path: $(OBSPath)
- script: ./ci/windows/prepare-obs-windows.cmd
displayName: 'Checkout & CMake OBS Studio'
env:
build_config: $(build_config)
DepsPath32: $(DepsPath32)
DepsPath64: $(DepsPath64)
QTDIR32: $(QTDIR32)
QTDIR64: $(QTDIR64)
OBSPath: $(OBSPath)
- task: MSBuild@1
displayName: 'Build OBS Studio 32-bit'
inputs:
msbuildArguments: '/m /p:Configuration=$(build_config)'
solution: '$(OBSPath)\build32\obs-studio.sln'
- task: MSBuild@1
displayName: 'Build OBS Studio 64-bit'
inputs:
msbuildArguments: '/m /p:Configuration=$(build_config)'
solution: '$(OBSPath)\build64\obs-studio.sln'
- script: ./ci/windows/prepare-windows.cmd
displayName: 'Prepare libraries for Rust build'
env:
OBS_PATH: $(OBSPath)
- script: echo "##vso[task.setvariable variable=PATH;]%PATH%;$(QTDIR64)\bin;$(QTDIR32)\bin"
displayName: 'Update path for Qt'
- script: cargo build --release --target x86_64-pc-windows-msvc
displayName: 'Build Plugin 64-bit'
env:
QT_INCLUDE_DIR: '$(QTDIR64)\include'
QT_LIB_DIR: '$(QTDIR64)\lib'
LIBOBS_INCLUDE_DIR: '$(OBSPath)'
LIBOBS_LIB: '$(OBSPath)\build64\libobs\RelWithDebInfo'
OBS_FRONTEND_LIB: '$(OBSPath)\build64\UI\obs-frontend-api\RelWithDebInfo'
LIBCLANG_PATH: 'C:\Program Files\LLVM\bin'
- script: cargo build --release --target i686-pc-windows-msvc
displayName: 'Build Plugin 32-bit'
env:
QT_INCLUDE_DIR: '$(QTDIR32)\include'
QT_LIB_DIR: '$(QTDIR32)\lib'
LIBOBS_INCLUDE_DIR: '$(OBSPath)'
LIBOBS_LIB: '$(OBSPath)\build32\libobs\RelWithDebInfo'
OBS_FRONTEND_LIB: '$(OBSPath)\build32\UI\obs-frontend-api\RelWithDebInfo'
LIBCLANG_PATH: 'C:\Program Files\LLVM\bin'
- script: |
rename target\x86_64-pc-windows-msvc\release\*.dll *-win64.dll
rename target\i686-pc-windows-msvc\release\*.dll *-win32.dll
displayName: Rename files for publish
- task: CopyFiles@2
inputs:
sourceFolder: './target/x86_64-pc-windows-msvc/release'
contents: '*.dll'
targetFolder: '$(Build.ArtifactStagingDirectory)/64'
- task: CopyFiles@2
inputs:
sourceFolder: './target/i686-pc-windows-msvc/release'
contents: '*.dll'
targetFolder: '$(Build.ArtifactStagingDirectory)/32'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)/64'
artifactName: win-64
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)/32'
artifactName: win-32
- job: 'Build_Linux'
pool:
vmImage: 'ubuntu-20.04'
variables:
BUILD_REASON: $(Build.Reason)
BRANCH_SHORT_NAME: $(Build.SourceBranchName)
BRANCH_FULL_NAME: $(Build.SourceBranch)
steps:
- checkout: self
submodules: true
- script: ./ci/linux/install-dependencies-ubuntu.sh
displayName: 'Install dependencies'
- task: Cache@2
displayName: Cargo target cache
inputs:
key: 'rust-target | "$(Agent.OS)"'
restoreKeys: |
rust-target | "$(Agent.OS)"
path: target
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install Rust
- script: ./ci/linux/build-ubuntu.sh
displayName: 'Build Plugin'
- task: CopyFiles@2
inputs:
sourceFolder: './target/release'
contents: '*.so'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: linux-64
- job: 'Build_macOS'
pool:
vmImage: 'macos-10.14'
steps:
- checkout: self
submodules: true
- script: ./ci/macos/install-dependencies-macos.sh
displayName: 'Install dependencies'
- script: ./ci/macos/install-build-obs-macos.sh
displayName: 'Build OBS'
- task: Cache@2
displayName: Cargo target cache
inputs:
key: 'rust-target | "$(Agent.OS)"'
restoreKeys: |
rust-target | "$(Agent.OS)"
path: target
- script: |
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
displayName: Install Rust
- script: ./ci/macos/build-macos.sh
displayName: 'Build Plugin'
- task: CopyFiles@2
inputs:
sourceFolder: './target/release'
contents: '*.dylib'
targetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: mac-64