-
Notifications
You must be signed in to change notification settings - Fork 2
233 lines (195 loc) · 9.01 KB
/
ci.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
name: Flutter Engine
on:
schedule:
- cron: 24 0/12 * * *
workflow_dispatch:
jobs:
build:
strategy:
fail-fast: false
matrix:
channel: [stable, beta] # master
config:
# Debug builds not needed: fetched from Google
- tag: host_profile
gn: --embedder-for-target --runtime-mode profile --lto
host: ubuntu-latest
host_tag: linux_x64
- tag: host_profile
gn: --embedder-for-target --runtime-mode profile --lto
host: macos-latest
host_tag: macosx_x64
- tag: host_profile
gn: --embedder-for-target --runtime-mode profile --lto
host: windows-2019
host_tag: windows_x64
- tag: host_release
gn: --embedder-for-target --runtime-mode release --lto --stripped
host: ubuntu-latest
host_tag: linux_x64
- tag: host_release
gn: --embedder-for-target --runtime-mode release --lto --stripped
host: macos-latest
host_tag: macosx_x64
- tag: host_release
gn: --embedder-for-target --runtime-mode release --lto --stripped
host: windows-2019
host_tag: windows_x64
runs-on: ${{ matrix.config.host }}
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
GYP_MSVS_OVERRIDE_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise
PYTHONIOENCODING: utf-8
PYTHONLEGACYWINDOWSSTDIO: utf-8
steps:
- name: Free up space
if: matrix.config.host == 'ubuntu-latest'
run: |
pwd
sudo df -h
sudo find /opt -maxdepth 1 ! -name hostedtoolcache ! -name opt | sudo xargs rm -rf
sudo rm -rf /usr/share/dotnet
sudo df -h
- name: Install curl (windows)
if: matrix.config.host == 'windows-2019'
run: choco install curl
- name: Get engine version
id: get_engine_version
run: |
value=`curl https://raw.githubusercontent.com/flutter/flutter/${{ matrix.channel }}/bin/internal/engine.version`
echo ::set-output name=engine_version::$value
shell: bash
- name: Create release
if: github.event_name != 'pull_request'
continue-on-error: true
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PERMANENT_GITHUB_TOKEN }}
with:
tag_name: f-${{ steps.get_engine_version.outputs.engine_version }}
release_name: Flutter Engine ${{ steps.get_engine_version.outputs.engine_version }}
- name: Check release
if: github.event_name != 'pull_request'
id: release_check
run: |
url="https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/f-${{ steps.get_engine_version.outputs.engine_version }}"
header="Authorization: token ${{ secrets.PERMANENT_GITHUB_TOKEN }}"
content=`curl --header "$header" $url`
echo $content
assets=`echo $content | jq .assets[].name`
echo $assets
if echo $assets | grep -q ${{ matrix.config.host_tag }}-${{ matrix.config.tag }}.zip
then
echo Skipping build
echo ::set-output name=skip_build::true
fi
shell: bash
- name: Checkout
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
uses: actions/checkout@v3
- name: Checkout (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
run: git clone https://github.com/${{github.repository}} C:\repo
- name: Install Python 3.x
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'macos-latest'
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies (ubuntu)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'ubuntu-latest'
run: sudo apt-get install patch tree zip
- name: Install dependencies (macos)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'macos-latest'
run: brew install binutils gpatch tree
- name: Install dependencies (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
run: choco install patch tree zip
- name: Install depot tools
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: ./fetch-depot-tools.sh
shell: bash
- name: Install depot tools (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: ./fetch-depot-tools.sh
shell: bash
- name: Download engine (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: ./fetch-engine.bat ${{ steps.get_engine_version.outputs.engine_version }}
- name: Download engine (macos + ubuntu)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: ./fetch-engine.sh ${{ steps.get_engine_version.outputs.engine_version }}
shell: bash
- name: Patch
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: ./patch-engine.sh
shell: bash
- name: Patch (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: ./patch-engine.sh
shell: bash
- name: Generate config
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: ./gn.sh ${{ matrix.config.gn }}
shell: bash
- name: Generate config (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: ./gn.sh ${{ matrix.config.gn }}
shell: bash
- name: Build
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: ./build.sh ${{ matrix.config.tag }}
shell: bash
- name: Build (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: ./build.sh ${{ matrix.config.tag }}
shell: bash
- name: Print out tree
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: tree ./engine/src/out/
shell: bash
- name: Print out tree (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: tree ./engine/src/out/
shell: bash
- name: Print release tree
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: tree ./engine_out/
shell: bash
- name: Print release tree (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: tree ./engine_out/
shell: bash
- name: Create release zip
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host != 'windows-2019'
run: cd engine_out && zip -qq -r ../${{ matrix.config.host_tag }}-${{ matrix.config.tag }}.zip ./*
shell: bash
- name: Create release zip (windows)
if: steps.release_check.outputs.skip_build != 'true' && matrix.config.host == 'windows-2019'
working-directory: C:\repo
run: cd engine_out && zip -qq -r ../${{ matrix.config.host_tag }}-${{ matrix.config.tag }}.zip ./*
shell: bash
- name: Upload release asset
if: steps.release_check.outputs.skip_build != 'true' && github.event_name != 'pull_request' && matrix.config.host != 'windows-2019'
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.PERMANENT_GITHUB_TOKEN }}
with:
tag_name: f-${{ steps.get_engine_version.outputs.engine_version }}
name: Flutter ${{ steps.get_engine_version.outputs.engine_version }}
files: ${{ matrix.config.host_tag }}-${{ matrix.config.tag }}.zip
- name: Upload release asset (windows)
if: steps.release_check.outputs.skip_build != 'true' && github.event_name != 'pull_request' && matrix.config.host == 'windows-2019'
uses: softprops/action-gh-release@master
env:
GITHUB_TOKEN: ${{ secrets.PERMANENT_GITHUB_TOKEN }}
with:
tag_name: f-${{ steps.get_engine_version.outputs.engine_version }}
name: Flutter ${{ steps.get_engine_version.outputs.engine_version }}
files: C:\repo\${{ matrix.config.host_tag }}-${{ matrix.config.tag }}.zip # hope this works!