-
Notifications
You must be signed in to change notification settings - Fork 36
250 lines (242 loc) · 11.6 KB
/
build.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
skip_release:
description: 'Skip release related steps? (true/false)'
required: true
default: 'false'
permissions:
contents: write
env:
version: m126-6fd3120c1b-1
jobs:
macos:
runs-on: ${{ fromJson('{"macos":"macos-13","ios":"macos-13","iosSim":"macos-13","tvos":"macos-13","tvosSim":"macos-13"}')[matrix.target] }}
strategy:
matrix:
target: ["macos", "ios", "iosSim", "tvos", "tvosSim"]
machine: ["x64", "arm64"]
build_type: [Release, Debug]
exclude:
- target: tvos
machine: x64
fail-fast: false
steps:
- uses: actions/checkout@v2
- run: python3 script/check_release.py --version ${{ env.version }} --target ${{ matrix.target }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Print Xcode version
run: xcodebuild -version
- run: python3 script/checkout.py --version ${{ env.version }}
- run: python3 script/build.py --build-type ${{ matrix.build_type }} --target ${{ matrix.target }} --machine ${{ matrix.machine }}
- run: python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target ${{ matrix.target }} --machine ${{ matrix.machine }}
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
name: Skia-${{ env.version }}-${{ matrix.target }}-${{ matrix.build_type }}-${{ matrix.machine }}.zip
path: '*.zip'
- run: python3 script/release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target ${{ matrix.target }} --machine ${{ matrix.machine }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux:
runs-on: ubuntu-latest
container: ubuntu:20.04
strategy:
matrix:
build_type: [Debug, Release]
fail-fast: false
steps:
- uses: actions/checkout@v2
- run: ./script/prepare_linux.sh
- run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/checkout.py --version ${{ env.version }}
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/build.py --build-type ${{ matrix.build_type }}
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
name: Skia-${{ env.version }}-linux-${{ matrix.build_type }}-x64.zip
path: '*.zip'
- run: python3 script/release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-wasm:
runs-on: ubuntu-latest
container: ubuntu:20.04
strategy:
matrix:
build_type: [ Debug, Release ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- run: ./script/prepare_linux_wasm.sh
- run: python3 script/check_release.py --version ${{ env.version }} --target wasm --build-type ${{ matrix.build_type }} --machine wasm
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: python3 script/checkout.py --version ${{ env.version }}
- run: python3 script/build.py --target wasm --machine wasm --build-type ${{ matrix.build_type }}
- run: python3 script/archive.py --version ${{ env.version }} --target wasm --machine wasm --build-type ${{ matrix.build_type }}
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
name: Skia-${{ env.version }}-wasm-${{ matrix.build_type }}-wasm.zip
path: '*.zip'
- run: python3 script/release.py --version ${{ env.version }} --target wasm --machine wasm --build-type ${{ matrix.build_type }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-android:
runs-on: ubuntu-latest
container: ubuntu:20.04
strategy:
matrix:
build_type: [ Debug, Release ]
machine: ["x64", "arm64"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- run: ./script/prepare_linux.sh
- run: python3 script/check_release.py --version ${{ env.version }} --target android --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: python3 script/checkout.py --version ${{ env.version }}
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
- run: python3 script/build.py --target android --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }} --ndk ${{ steps.setup-ndk.outputs.ndk-path }}
- run: python3 script/archive.py --version ${{ env.version }} --target android --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
name: Skia-${{ env.version }}-android-${{ matrix.build_type }}-${{ matrix.machine }}.zip
path: '*.zip'
- run: python3 script/release.py --version ${{ env.version }} --target android --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
linux-arm64:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [ Debug, Release ]
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: uraimo/[email protected]
name: Assemble
id: assemble
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Mount checkout directory as /checkout in the container
dockerRunArgs: |
--volume "${GITHUB_WORKSPACE}:/checkout"
env: |
build_type: ${{ matrix.build_type }}
build_version: ${{ env.version }}
artifact_name: Skia-${{ env.version }}-linux-${{ matrix.build_type }}-arm64.zip
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The shell to run commands with in the container
shell: /bin/bash
install: |
apt-get update -q -y
apt-get install -q -y bash
run: |
cd /checkout
/bin/bash script/prepare_linux_arm.sh
python3 script/check_release.py --version ${build_version} --build-type ${build_type}
python3 script/checkout.py --version ${build_version}
python3 script/build.py --build-type ${build_type} --build-type ${build_type}
python3 script/archive.py --version ${build_version} --build-type ${build_type}
echo "Produced artifact at ${PWD}/${artifact_name}"
- uses: uraimo/[email protected]
name: Test Build
id: test-build
if: ${{ github.event.inputs.skip_release == 'true' || github.ref != 'refs/heads/main' }}
with:
arch: aarch64
distro: ubuntu20.04
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Mount checkout directory as /checkout in the container
dockerRunArgs: |
--volume "${GITHUB_WORKSPACE}:/checkout"
env: |
build_type: ${{ matrix.build_type }}
build_version: ${{ env.version }}
artifact_name: Skia-${{ env.version }}-linux-${{ matrix.build_type }}-arm64.zip
# The shell to run commands with in the container
shell: /bin/bash
install: |
apt-get update -q -y
apt-get install -q -y bash
run: |
cd /checkout
/bin/bash script/prepare_linux_arm.sh
python3 script/checkout.py --version ${build_version}
python3 script/build.py --build-type ${build_type} --build-type ${build_type}
echo "Verified build"
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
name: Skia-${{ env.version }}-linux-${{ matrix.build_type }}-arm64.zip
path: '*.zip'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: python3 script/release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target linux --machine arm64
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows:
runs-on: windows-2019
strategy:
matrix:
build_type: [Debug, Release]
machine: ["x64", "arm64"]
fail-fast: false
steps:
- run: git config --global core.autocrlf input
- uses: actions/checkout@v2
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- shell: bash
run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: microsoft/setup-msbuild@v1
- uses: ilammy/msvc-dev-cmd@v1
- shell: bash
run: python3 script/checkout.py --version ${{ env.version }}
- shell: bash
run: python3 script/build.py --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }}
- shell: bash
run: python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }}
- uses: actions/upload-artifact@v3
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
with:
name: Skia-${{ env.version }}-windows-${{ matrix.build_type }}-${{ matrix.machine }}.zip
path: '*.zip'
- shell: bash
run: python3 script/release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --target windows --machine ${{ matrix.machine }}
if: ${{ github.event.inputs.skip_release != 'true' && github.ref == 'refs/heads/main' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}