-
Notifications
You must be signed in to change notification settings - Fork 41
/
azure-pipelines.yml
202 lines (201 loc) · 7.55 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
trigger:
branches:
exclude:
- master
tags:
include:
- '*'
exclude:
- '*-test*'
stages:
- stage: test
displayName: 'Build & Test'
jobs:
- job: macos
strategy:
matrix:
macosSwift57:
imageName: 'macOS-13'
DEVELOPER_DIR: '/Applications/Xcode_14.2.app'
IOS_SIMULATOR: 'iPhone 14'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 (44mm)'
macosSwift58:
imageName: 'macOS-13'
DEVELOPER_DIR: '/Applications/Xcode_14.3.1.app'
IOS_SIMULATOR: 'iPhone 14'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 (44mm)'
macosSwift59:
imageName: 'macOS-14'
DEVELOPER_DIR: '/Applications/Xcode_15.2.app'
IOS_SIMULATOR: 'iPhone 15'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 (44mm)'
macosSwift510:
imageName: 'macOS-15'
DEVELOPER_DIR: '/Applications/Xcode_15.4.app'
IOS_SIMULATOR: 'iPhone 15'
WATCHOS_SIMULATOR: 'Apple Watch Series 6 (44mm)'
macosSwift60:
imageName: 'macOS-15'
DEVELOPER_DIR: '/Applications/Xcode_16.2.app'
IOS_SIMULATOR: 'iPhone 16'
WATCHOS_SIMULATOR: 'Apple Watch Series 10 (42mm)'
pool:
vmImage: $(imageName)
variables:
GIT_LFS_SKIP_SMUDGE: 1
steps:
- 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
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:
linuxSwift57:
imageName: 'ubuntu-22.04'
containerImage: 'swift:5.7.3-jammy'
linuxSwift58:
imageName: 'ubuntu-22.04'
containerImage: 'swift:5.8.1-jammy'
linuxSwift59:
imageName: 'ubuntu-22.04'
containerImage: 'swift:5.9.2-jammy'
linuxSwift510:
imageName: 'ubuntu-24.04'
containerImage: 'swift:5.10.1-noble'
linuxSwift60:
imageName: 'ubuntu-24.04'
containerImage: 'swift:6.0.3-noble'
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:
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'
XCTEST_LIB_PATH: '\x86_64'
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'
XCTEST_LIB_PATH: '\x86_64'
windowsSwift59:
imageName: 'windows-2019'
SWIFT_VERSION: '5.9.2'
ICU_PATH: 'C:\Program Files\swift\icu-69.1\usr\bin'
SWIFT_DEV_PATH: 'C:\Program Files\swift\runtime-development\usr\bin'
XCTEST_LIB_PATH: '\x86_64'
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%;%LocalAppData%\Programs\Swift;%PATH%
swift.exe --version
swift.exe build %SWIFTFLAGS%
swift.exe build -c release %SWIFTFLAGS%
displayName: 'Build SPM Debug & Release'
- job: windowsDocker
strategy:
matrix:
windowsSwift510:
imageName: 'windows-2022'
containerImage: 'swift:5.10.1-windowsservercore-ltsc2022'
windowsSwift60:
imageName: 'windows-2022'
containerImage: 'swift:6.0.3-windowsservercore-ltsc2022'
pool:
vmImage: $(imageName)
container: $[ variables['containerImage'] ]
steps:
- script: |
swift.exe --version
swift.exe build
swift.exe build -c release
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-14'
variables:
DEVELOPER_DIR: '/Applications/Xcode_15.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'