forked from libimobiledevice-win32/libimobiledevice-vs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
227 lines (203 loc) · 12 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
227
jobs:
- job: windows
strategy:
maxParallel: 4
matrix:
x64:
BUILD_ARCH: x64
PLATFORM: x64
RID: win-x64
x86:
BUILD_ARCH: x86
PLATFORM: Win32
RID: win-x86
pool:
vmImage: 'windows-2019'
steps:
- script: |
get-source.cmd
displayName: Get libimobiledevice source code
- script: |
%VCPKG_INSTALLATION_ROOT%\vcpkg version
%VCPKG_INSTALLATION_ROOT%\vcpkg integrate install
echo.set(VCPKG_BUILD_TYPE %CONFIGURATION%)>> %VCPKG_INSTALLATION_ROOT%\triplets\%BUILD_ARCH%-windows.cmake
cat %VCPKG_INSTALLATION_ROOT%\triplets\%BUILD_ARCH%-windows.cmake
%VCPKG_INSTALLATION_ROOT%\vcpkg install libiconv:%BUILD_ARCH%-windows zlib:%BUILD_ARCH%-windows openssl:%BUILD_ARCH%-windows dirent:%BUILD_ARCH%-windows getopt:%BUILD_ARCH%-windows curl:%BUILD_ARCH%-windows libzip:%BUILD_ARCH%-windows libxml2:%BUILD_ARCH%-windows libusb:%BUILD_ARCH%-windows libusb-win32:%BUILD_ARCH%-windows pthreads:%BUILD_ARCH%-windows readline:%BUILD_ARCH%-windows pcre:%BUILD_ARCH%-windows
dir %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\bin\
dir %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\lib\
displayName: Install dependencies
- task: MSBuild@1
inputs:
solution: 'libimobiledevice-vs.sln'
platform: $(PLATFORM)
configuration: Release
displayName: 'Release build'
- script: |
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\bin\
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\
mkdir %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\sources\
REM Copy artifacts
copy %PLATFORM%\Release\*.dll %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\bin\
copy %PLATFORM%\Release\*.exe %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\bin\
copy %PLATFORM%\Release\*.pdb %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\bin\
REM Copy vcpkg licenses
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\share\libxml2\copyright %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libxml2.copyright
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\share\libiconv\copyright %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libiconv.copyright
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\share\liblzma\copyright %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\liblzma.copyright
copy %VCPKG_INSTALLATION_ROOT%\installed\%BUILD_ARCH%-windows\share\curl\copyright %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libcurl.copyright
REM Copy git licenses
copy libplist\COPYING.LESSER %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libplist.library.copyright
copy libplist\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libplist.utilities.copyright
copy libusbmuxd\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libusbmuxd.copyright
copy libimobiledevice\COPYING.LESSER %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libimobiledevice.library.copyright
copy libimobiledevice\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libimobiledevice.utilities.copyright
copy usbmuxd\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\usbmuxd.copyright
copy libideviceactivation\COPYING.LESSER %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libideviceactivation.library.copyright
copy libideviceactivation\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libideviceactivation.utilities.copyright
copy ideviceinstaller\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\ideviceinstaller.copyright
copy libirecovery\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\libirecovery.copyright
copy idevicerestore\COPYING %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\licenses\idevicerestore.copyright
REM Copy git version information
git -C libplist rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libplist
git -C libplist config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libplist
git -C libusbmuxd rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libusbmuxd
git -C libusbmuxd config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libusbmuxd
git -C libimobiledevice rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libimobiledevice
git -C libimobiledevice config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libimobiledevice
git -C usbmuxd rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\usbmuxd
git -C usbmuxd config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\usbmuxd
git -C libideviceactivation rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libideviceactivation
git -C libideviceactivation config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libideviceactivation
git -C ideviceinstaller rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\ideviceinstaller
git -C ideviceinstaller config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\ideviceinstaller
git -C libirecovery rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libirecovery
git -C libirecovery config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\libirecovery
git -C idevicerestore rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\idevicerestore
git -C idevicerestore config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\idevicerestore
git -C ios-webkit-debug-proxy rev-parse HEAD >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\ios-webkit-debug-proxy
git -C ios-webkit-debug-proxy config --get remote.origin.url >> %BUILD_ARTIFACTSTAGINGDIRECTORY%\libimobiledevice\%RID%\gitinfo\ios-webkit-debug-proxy
REM Get tarballs
git -C libplist archive --prefix=libplist/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/libplist.orig.tar.gz HEAD
git -C libusbmuxd archive --prefix=libusbmuxd/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/libusbmuxd.orig.tar.gz HEAD
git -C libimobiledevice archive --prefix=libimobiledevice/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/libimobiledevice.orig.tar.gz HEAD
git -C usbmuxd archive --prefix=usbmuxd/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/usbmuxd.orig.tar.gz HEAD
git -C libideviceactivation archive --prefix=libideviceactivation/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/libideviceactivation.orig.tar.gz HEAD
git -C ideviceinstaller archive --prefix=ideviceinstaller/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/ideviceinstaller.orig.tar.gz HEAD
git -C libirecovery archive --prefix=libirecovery/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/libirecovery.orig.tar.gz HEAD
git -C idevicerestore archive --prefix=idevicerestore/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/idevicerestore.orig.tar.gz HEAD
git -C idevicerestore archive --prefix=ios-webkit-debug-proxy/ --format tar.gz -o %BUILD_ARTIFACTSTAGINGDIRECTORY%/libimobiledevice/%RID%/sources/ios-webkit-debug-proxy.orig.tar.gz HEAD
displayName: 'Prepare artifact'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/libimobiledevice'
artifactName: 'libimobiledevice'
publishLocation: 'Container'
displayName: Publish
- job: macos
pool:
vmImage: 'xcode9-macos10.13'
variables:
TARGET: x86_64-apple-darwin
RID: osx-x64
steps:
- script: |
brew install autoconf automake libtool pkg-config libzip libusb
displayName: Install autotools
- template: build-unix.yaml
- script: |
cp /usr/local/opt/openssl/lib/libssl.1.0.0.dylib $SYSTEM_ARTIFACTSDIRECTORY/libimobiledevice/$RID/lib
cp /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib $SYSTEM_ARTIFACTSDIRECTORY/libimobiledevice/$RID/lib
export INSTALLDIR=$SYSTEM_ARTIFACTSDIRECTORY/libimobiledevice/$RID
./build/patchdylib.sh
displayName: Patch dylib files
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/libimobiledevice'
artifactName: 'libimobiledevice'
publishLocation: 'Container'
displayName: Publish
- job: ubuntu
strategy:
maxParallel: 4
matrix:
ubuntu_1604:
imageName: ubuntu:16.04
rid: ubuntu.16.04-x64
ubuntu_1804:
imageName: ubuntu:18.04
rid: ubuntu.18.04-x64
variables:
TARGET: x86_64-unknown-linux-gnu
CFLAGS: -fPIC
pool:
vmImage: 'ubuntu-16.04'
container:
image: $(imageName)
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: Set up sudo
- script: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y --no-install-recommends lsb-release automake make libtool clang libssl-dev gnupg pkg-config git ca-certificates libcurl4-openssl-dev libxml2-dev libzip-dev libreadline-dev libusb-1.0-0-dev wget
displayName: Install build dependencies
- template: build-unix.yaml
- script: |
export INSTALLDIR=$SYSTEM_ARTIFACTSDIRECTORY/libimobiledevice/$RID
./build/install-patchelf.sh
./build/run-patchelf.sh
displayName: Patch so files
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/libimobiledevice'
artifactName: 'libimobiledevice'
publishLocation: 'Container'
displayName: Publish
- job: rhel
strategy:
maxParallel: 4
matrix:
fedora_29:
imageName: fedora:29
rid: fedora.29-x64
fedora_30:
imageName: fedora:30
rid: fedora.30-x64
centos_7:
imageName: centos:7
rid: centos.7-x64
centos_8:
imageName: centos:8
rid: centos.8-x64
variables:
TARGET: x86_64-unknown-linux-gnu
CFLAGS: -fPIC
pool:
vmImage: 'ubuntu-16.04'
container:
image: $(imageName)
options: "--name ci-container -v /usr/bin/docker:/tmp/docker:ro"
steps:
- script: |
/tmp/docker exec -t -u 0 ci-container \
sh -c "yum install -y sudo"
displayName: Set up sudo
- script: |
sudo yum install -y libtool automake make gcc gcc-c++ git openssl-devel libusbx-devel glib2-devel readline-devel glibc-devel zlib-devel libzip-devel libcurl-devel libxml2-devel
displayName: Install build dependencies
- template: build-unix.yaml
- script: |
export INSTALLDIR=$SYSTEM_ARTIFACTSDIRECTORY/libimobiledevice/$RID
./build/install-patchelf.sh
./build/run-patchelf.sh
displayName: Patch so files
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/libimobiledevice'
artifactName: 'libimobiledevice'
publishLocation: 'Container'
displayName: Publish