forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 19
238 lines (201 loc) · 7.87 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
name: Build
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
container:
image: ghcr.io/flutter-tizen/build-engine:latest
credentials:
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
arch: [arm, arm64, x86]
mode: [debug, release, profile]
include:
- arch: arm
triple: arm-linux-gnueabi
- arch: arm64
triple: aarch64-linux-gnu
- arch: x86
triple: i686-linux-gnu
exclude:
- arch: x86
mode: release
- arch: x86
mode: profile
steps:
- uses: actions/checkout@v4
with:
path: src/flutter
fetch-depth: 0
- uses: actions/cache@v4
with:
path: /tizen_tools/sysroot
key: sysroot
- name: Install depot_tools
run: |
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo "$PWD/depot_tools" >> $GITHUB_PATH
- name: Run gclient sync
run: |
gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --var=download_fuchsia_deps=False --deps-file=src/flutter/DEPS
gclient sync -v --no-history --shallow
- name: Generate sysroot
run: src/flutter/ci/tizen/generate_sysroot.py --out /tizen_tools/sysroot
- name: Build
run: |
# Ignore unsupported linker option.
sed -i "/-Wl,--undefined-version/d" src/build/config/compiler/BUILD.gn
src/flutter/tools/gn \
--target-os linux \
--linux-cpu ${{ matrix.arch }} \
--no-goma \
--target-toolchain /tizen_tools/toolchains \
--target-sysroot /tizen_tools/sysroot/${{ matrix.arch }} \
--target-triple ${{ matrix.triple }} \
--runtime-mode ${{ matrix.mode }} \
--enable-fontconfig \
--disable-desktop-embeddings \
--target-dir build
ninja -C src/out/build flutter_engine_library
cp -f src/flutter/third_party/icu/flutter/icudtl.dat src/out/build
- name: Build gen_snapshot
if: ${{ matrix.mode != 'debug' }}
run: ninja -C src/out/build clang_x64/gen_snapshot
- uses: actions/upload-artifact@v4
with:
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}
path: |
src/out/build/libflutter_engine.so
src/out/build/icudtl.dat
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: ${{ github.event_name == 'push' }}
with:
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_symbols
path: src/out/build/so.unstripped/libflutter_engine.so
if-no-files-found: error
- uses: actions/upload-artifact@v4
if: ${{ matrix.mode != 'debug' }}
with:
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_linux-x64
path: src/out/build/clang_x64/gen_snapshot
if-no-files-found: error
windows-build:
runs-on: windows-latest
strategy:
matrix:
arch: [arm, arm64]
mode: [release, profile]
steps:
- name: Run git checkout
run: |
mkdir C:\workspace\engine\src\flutter
cd C:\workspace\engine\src\flutter
git config --global core.autocrlf true
git init --quiet
git remote add origin https://github.com/${{ github.repository }}
git fetch --depth 1 origin ${{ github.sha }}
git checkout FETCH_HEAD
- name: Environment setup
run: |
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -Force
echo "DEPOT_TOOLS_WIN_TOOLCHAIN=0" >> $Env:GITHUB_ENV
echo "GYP_MSVS_OVERRIDE_PATH=C:\Program Files\Microsoft Visual Studio\2022\Enterprise" >> $Env:GITHUB_ENV
echo "WINDOWSSDKDIR=C:\Program Files (x86)\Windows Kits\10" >> $Env:GITHUB_ENV
- name: Install depot_tools
run: |
Invoke-WebRequest -Uri https://storage.googleapis.com/chrome-infra/depot_tools.zip -OutFile depot_tools.zip
7z x -y -o"C:\workspace\depot_tools" .\depot_tools.zip
echo "C:\workspace\depot_tools" >> $Env:GITHUB_PATH
- name: Run gclient sync
working-directory: C:\workspace\engine
shell: powershell
run: |
gclient config --name=src\flutter --unmanaged https://github.com/flutter-tizen/engine
gclient setdep --var=download_dart_sdk=False --deps-file=src/flutter/DEPS
gclient sync -v --no-history --shallow
- name: Build
working-directory: C:\workspace\engine\src
run: |
python3 .\flutter\tools\gn `
--linux `
--linux-cpu=${{ matrix.arch }} `
--runtime-mode=${{ matrix.mode }} `
--no-goma `
--target-dir build
ninja -C .\out\build gen_snapshot
- uses: actions/upload-artifact@v4
with:
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_windows-x64
path: C:\workspace\engine\src\out\build\gen_snapshot.exe
if-no-files-found: error
macos-build:
runs-on: macos-latest
strategy:
matrix:
arch: [arm, arm64]
mode: [release, profile]
steps:
- uses: actions/checkout@v4
with:
path: src/flutter
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install depot_tools
run: |
git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
echo "$PWD/depot_tools" >> $GITHUB_PATH
- name: Run gclient sync
run: |
gclient config --name=src/flutter --unmanaged https://github.com/flutter-tizen/engine
gclient setdep --var=download_dart_sdk=False --var=download_android_deps=False --deps-file=src/flutter/DEPS
gclient sync -v --no-history --shallow
- name: Build
run: |
# Change host_toolchain to mac/clang_x64.
sed -i "" "s|//build/toolchain/linux:clang_$host_cpu|//build/toolchain/mac:clang_$host_cpu|g" src/build/config/BUILDCONFIG.gn
# Pass dummy values to prevent using the default (Linux) toolchain.
src/flutter/tools/gn \
--linux \
--linux-cpu=${{ matrix.arch }} \
--no-goma \
--target-toolchain _ \
--target-sysroot _ \
--target-triple _ \
--runtime-mode=${{ matrix.mode }} \
--disable-desktop-embeddings \
--target-dir build
ninja -C src/out/build clang_x64/gen_snapshot
- uses: actions/upload-artifact@v4
with:
name: tizen-${{ matrix.arch }}-${{ matrix.mode }}_darwin-x64
path: src/out/build/clang_x64/gen_snapshot
if-no-files-found: error
release:
needs: [build, windows-build, macos-build]
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- name: Create archives
run: |
for name in tizen-*; do
7z a $name.zip ./$name/*
done
- name: Set variables
run: |
echo "SHORT_SHA=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_ENV
echo "VERSION=$(echo "${{ github.ref_name }}" | cut -d'-' -f2)" >> $GITHUB_ENV
- uses: softprops/action-gh-release@v2
with:
name: ${{ env.VERSION }} (${{ env.SHORT_SHA }})
tag_name: ${{ env.SHORT_SHA }}
target_commitish: ${{ github.sha }}
files: tizen-*.zip
body: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}