forked from tsolomko/SWCompression
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
226 lines (225 loc) · 8.57 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
trigger:
branches:
exclude:
- master
tags:
include:
- '*'
exclude:
- '*-test*'
stages:
- stage: test
displayName: 'Build & Test'
jobs:
- job: macos
strategy:
matrix:
macosSwift52:
imageName: 'macOS-11'
DEVELOPER_DIR: '/Applications/Xcode_11.7.app'
IOS_SIMULATOR: 'iPhone 8'
WATCHOS_ACTIONS: 'clean build'
WATCHOS_SIMULATOR: 'Apple Watch Series 4 - 44mm'
macosSwift53:
imageName: 'macOS-11'
DEVELOPER_DIR: '/Applications/Xcode_12.4.app'
IOS_SIMULATOR: 'iPhone 8'
WATCHOS_ACTIONS: 'clean build'
WATCHOS_SIMULATOR: 'Apple Watch Series 4 - 44mm'
UTILS_PW_XCF_FLAG: '--xcf'
macosSwift54:
imageName: 'macOS-11'
DEVELOPER_DIR: '/Applications/Xcode_12.5.1.app'
IOS_SIMULATOR: 'iPhone 8'
WATCHOS_ACTIONS: 'clean test'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 - 44mm'
UTILS_PW_XCF_FLAG: '--xcf'
macosSwift55:
imageName: 'macOS-12'
DEVELOPER_DIR: '/Applications/Xcode_13.2.1.app'
IOS_SIMULATOR: 'iPhone 8'
WATCHOS_ACTIONS: 'clean test'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 - 44mm'
UTILS_PW_XCF_FLAG: '--xcf'
macosSwift56:
imageName: 'macOS-12'
DEVELOPER_DIR: '/Applications/Xcode_13.4.1.app'
IOS_SIMULATOR: 'iPhone 8'
WATCHOS_ACTIONS: 'clean test'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 - 44mm'
UTILS_PW_XCF_FLAG: '--xcf'
macosSwift57:
imageName: 'macOS-13'
DEVELOPER_DIR: '/Applications/Xcode_14.2.app'
IOS_SIMULATOR: 'iPhone 14'
WATCHOS_ACTIONS: 'clean test'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 (44mm)'
UTILS_PW_XCF_FLAG: '--xcf'
macosSwift58:
imageName: 'macOS-13'
DEVELOPER_DIR: '/Applications/Xcode_14.3.1.app'
IOS_SIMULATOR: 'iPhone 14'
WATCHOS_ACTIONS: 'clean test'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 (44mm)'
UTILS_PW_XCF_FLAG: '--xcf'
pool:
vmImage: $(imageName)
variables:
GIT_LFS_SKIP_SMUDGE: 1
steps:
- script: |
set -e -o xtrace
brew update
./utils.py ci install-git-lfs-macos
ls -a "Tests/Test Files"
displayName: 'Install Git LFS'
- script: |
set -e -o xtrace
git submodule update --init --recursive
cp "Tests/Test Files/gitattributes-copy" "Tests/Test Files/.gitattributes"
displayName: 'Update submodules'
- script: |
set -e -o xtrace
cd "Tests/Test Files"
git lfs ls-files -l | cut -d' ' -f1 | sort > ../../.assets-id
displayName: 'Generate assets-id'
- task: Cache@2
inputs:
key: '"swc_test_files_v3_" | .assets-id'
path: '.git/modules/Tests/Test Files/lfs'
displayName: 'Cache lfs of test files'
- script: |
set -e -o xtrace
cd "Tests/Test Files"
git lfs pull
git lfs checkout
displayName: 'Download or update test files'
- script: ./utils.py download-bbd-macos $UTILS_PW_XCF_FLAG
displayName: 'Download BitByteData'
- script: ./utils.py ci script-macos
displayName: 'Build & Test'
- script: swift build -c release
displayName: 'Build SPM Release'
- job: linux
strategy:
matrix:
linuxSwift52:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.2.5-focal'
linuxSwift53:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.3.3-focal'
linuxSwift54:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.4.3-focal'
linuxSwift55:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.5.3-focal'
linuxSwift56:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.6.3-focal'
linuxSwift57:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.7.3-focal'
linuxSwift58:
imageName: 'ubuntu-20.04'
containerImage: 'swift:5.8.1-focal'
pool:
vmImage: $(imageName)
container: $[ variables['containerImage'] ]
steps:
- script: |
set -e -o xtrace
swift --version
swift build
swift build -c release # Check Release build just in case.
displayName: 'Build SPM Debug & Release'
- job: windows
strategy:
matrix:
windowsSwift54:
imageName: 'windows-2019'
SWIFT_VERSION: '5.4.3'
ICU_PATH: 'C:\Library\icu-67\usr\bin'
SWIFT_DEV_PATH: 'C:\Library\Swift-development\bin'
windowsSwift55:
imageName: 'windows-2019'
SWIFT_VERSION: '5.5.3'
ICU_PATH: 'C:\Library\icu-67\usr\bin'
SWIFT_DEV_PATH: 'C:\Library\Swift-development\bin'
windowsSwift56:
imageName: 'windows-2019'
SWIFT_VERSION: '5.6.3'
ICU_PATH: 'C:\Library\icu-69.1\usr\bin'
SWIFT_DEV_PATH: 'C:\Library\Swift-development\bin'
windowsSwift57:
imageName: 'windows-2019'
SWIFT_VERSION: '5.7.3'
ICU_PATH: 'C:\Program Files\swift\icu-69.1\usr\bin'
SWIFT_DEV_PATH: 'C:\Program Files\swift\runtime-development\usr\bin'
windowsSwift58:
imageName: 'windows-2019'
SWIFT_VERSION: '5.8.1'
ICU_PATH: 'C:\Program Files\swift\icu-69.1\usr\bin'
SWIFT_DEV_PATH: 'C:\Program Files\swift\runtime-development\usr\bin'
pool:
vmImage: $(imageName)
variables:
DEVELOPER_DIR: 'C:\Library\Developer'
SDKROOT: 'C:\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk'
SWIFTFLAGS: '--sdk $(SDKROOT) -Xswiftc -sdk -Xswiftc $(SDKROOT) -Xswiftc -resource-dir -Xswiftc $(SDKROOT)/usr/lib/swift -Xswiftc -I -Xswiftc $(SDKROOT)/usr/lib/swift -Xswiftc -L -Xswiftc $(SDKROOT)/usr/lib/swift/windows'
steps:
- pwsh: Invoke-WebRequest -Uri https://swift.org/builds/swift-$(SWIFT_VERSION)-release/windows10/swift-$(SWIFT_VERSION)-RELEASE/swift-$(SWIFT_VERSION)-RELEASE-windows10.exe -OutFile swift-install.exe
displayName: 'Download Swift'
- task: BatchScript@1
inputs:
filename: .\swift-install.exe
arguments: /install /quiet
modifyEnvironment: true
displayName: 'Install Swift'
- script: |
set PATH=C:\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin;%SWIFT_DEV_PATH%;%ICU_PATH%;%PATH%
swift.exe --version
swift.exe build --target SWCompression %SWIFTFLAGS%
swift.exe build -c release --target SWCompression %SWIFTFLAGS%
displayName: 'Build SPM Debug & Release'
- stage: deploy
displayName: Deploy
dependsOn: test
# Deploy on tags only; test tags are excluded in trigger section.
condition: and(not(eq(variables['Build.Reason'], 'PullRequest')), startsWith(variables['Build.SourceBranch'], 'refs/tags'))
jobs:
- job: ghPages
displayName: 'Publish API docs to GH Pages'
pool:
vmImage: 'macOS-12'
variables:
DEVELOPER_DIR: '/Applications/Xcode_14.2.app'
steps:
- script: |
set -e -o xtrace
brew update
brew install sourcekitten
gem install -N jazzy
displayName: 'Install Tools'
- task: InstallSSHKey@0
inputs:
knownHostsEntry: 'github.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCj7ndNxQowgcQnjshcLrqPEiiphnt+VTTvDP6mHBL9j1aNUkY4Ue1gvwnGLVlOhGeYrnZaMgRK6+PKCUXaDbC7qtbW8gIkhL7aGCsOr/C56SJMy/BCZfxd1nWzAOxSDPgVsmerOBYfNqltV9/hWCqBywINIR+5dIg6JTJ72pcEpEjcYgXkE2YEFXV1JHnsKgbLWNlhScqb2UmyRkQyytRLtL+38TGxkxCflmO+5Z8CSSNY7GidjMIZ7Q4zMjA2n1nGrlTDkzwDCsw+wqFPGQA179cnfGWOWRVruj16z6XyvxvjJwbz0wQZ75XK5tKSb7FNyeIEs4TT4jk+S4dhPeAUC5y+bDYirYgM4GC7uEnztnZyaVWQ7B381AK4Qdrwt51ZqExKbQpTUNn+EjqoTwvqNj4kqx5QUCI0ThS/YkOxJCXmPUWZbhjpCg56i+2aB6CmK2JGhn57K5mj0MNdBXA4/WnwH6XoPWJzK5Nyu2zB3nAZp+S5hpQs+p1vN1/wsjk='
sshPublicKey: '$(swcPubDeployKey)'
sshKeySecureFile: 'swc_deploy_key'
displayName: 'Install an SSH key'
- script: git worktree add docs gh-pages
displayName: 'Prepare Worktree'
- script: ./utils.py ci before-deploy
displayName: 'Before Deploy'
- script: |
set -e -o xtrace
git config --local user.name "Azure Pipelines"
git config --local user.email "[email protected]"
cd docs
git add --all
git commit -m "Deploy to GH Pages [skip ci]" --amend
cd ..
git remote set-url --push origin [email protected]:tsolomko/SWCompression.git
git push --force origin gh-pages:gh-pages
displayName: 'Deploy to GH Pages'