-
-
Notifications
You must be signed in to change notification settings - Fork 249
260 lines (239 loc) · 7.61 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
251
252
253
254
255
256
257
258
259
260
name: build
on:
pull_request:
branches:
- master
push:
branches:
- master
workflow_dispatch:
env:
TAG_NAME: latest
TG_TOKEN: ${{secrets.TELEGRAM_TOKEN_BOT_OPENIPC}}
TG_CHANNEL: ${{secrets.TELEGRAM_CHANNEL_OPENIPC_DEV}}
TG_OPTIONS: -s -o /dev/null -w %{http_code}
jobs:
buildroot:
name: Firmware
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- hi3516cv100
- hi3518cv100
- hi3518ev100
- hi3516av100
- hi3516dv100
- hi3516cv200
- hi3518ev200
- hi3519v101
- hi3516av200
- hi3516cv300
- hi3516ev100
- hi3516cv500
- hi3516dv300
- hi3516av300
- hi3516ev200
- hi3516ev300
- hi3518ev300
- hi3516dv200
- hi3536cv100
- hi3536dv100
- gk7205v200
- gk7205v210
- gk7205v300
- gk7202v300
- gk7605v100
- ssc335
- ssc335de
- ssc337
- ssc337de
- ssc30kd
- ssc30kq
- ssc338q
- t31
- t40
release:
- lite
- ultimate
include:
- platform: hi3518ev200
release: mini
- platform: hi3516cv300
release: mini
- platform: hi3516ev200
release: fpv
- platform: hi3516ev300
release: fpv
- platform: gk7205v200
release: fpv
- platform: gk7205v300
release: fpv
- platform: hi3516ev200
release: lte
- platform: hi3516ev300
release: lte
- platform: gk7205v200
release: lte
- platform: gk7205v300
release: lte
# Original SDK test
- platform: gk7205v200
release: original
custom: onlyci
# MVP
- platform: fh8852v100
release: lite
- platform: fh8852v200
release: lite
- platform: gm8136
release: lite
- platform: nt98562
release: lite
- platform: nt98566
release: lite
- platform: rv1109
release: lite
- platform: rv1126
release: lite
- platform: ssc325
release: lite
- platform: t10
release: lite
- platform: t20
release: lite
- platform: t21
release: lite
- platform: t30
release: lite
- platform: xm510
release: lite
- platform: xm530
release: lite
- platform: xm550
release: lite
# TODO
- platform: ak3916ev300
release: lite
custom: onlyci
- platform: ak3918ev300
release: lite
custom: onlyci
- platform: dm36x
release: lite
custom: onlyci
- platform: gk7102
release: lite
- platform: gk7102s
release: lite
- platform: msc313e
release: lite
custom: onlyci
- platform: msc316dc
release: lite
custom: onlyci
- platform: msc316dm
release: lite
custom: onlyci
- platform: s3l
release: lite
custom: onlyci
exclude:
- platform: hi3516cv100
release: ultimate
- platform: hi3518cv100
release: ultimate
- platform: hi3518ev100
release: ultimate
- platform: hi3516cv200
release: ultimate
- platform: hi3519v101
release: ultimate
- platform: hi3516ev100
release: ultimate
- platform: hi3516cv500
release: ultimate
- platform: hi3516dv300
release: ultimate
- platform: hi3516av300
release: ultimate
- platform: hi3516dv200
release: ultimate
- platform: hi3536cv100
release: ultimate
- platform: hi3536dv100
release: ultimate
- platform: gk7605v100
release: ultimate
- platform: gk7205v210
release: ultimate
- platform: gk7202v300
release: ultimate
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup ccache
if: github.event_name != 'pull_request'
uses: actions/cache@v3
with:
path: /tmp/ccache
key: ${{matrix.platform}}_${{matrix.release}}
- name: Restore ccache
if: github.event_name == 'pull_request'
uses: actions/cache/restore@v3
with:
path: /tmp/ccache
key: ${{matrix.platform}}_${{matrix.release}}
- name: Download files
run: |
echo "8.8.8.8 invisible-mirror.net" | sudo tee -a /etc/hosts
echo "8.8.8.8 distfiles.dereferenced.org" | sudo tee -a /etc/hosts
make prepare
git clone https://github.com/openipc/br-cache
ln -s ${GITHUB_WORKSPACE}/br-cache $(ls -d output/buildroot-*)/dl
make BOARD=${{matrix.platform}}_${{matrix.release}} br-source
- name: Build firmware
run: |
export GIT_HASH=$(git rev-parse --short ${GITHUB_SHA})
export GIT_BRANCH=${GITHUB_REF_NAME}
echo GIT_HASH=${GIT_HASH} >> ${GITHUB_ENV}
echo GIT_BRANCH=${GIT_BRANCH} >> ${GITHUB_ENV}
mkdir -p /tmp/ccache
ln -s /tmp/ccache ${HOME}/.ccache
make BOARD=${{matrix.platform}}_${{matrix.release}} all
TIME=$(date -d @${SECONDS} +%M:%S)
echo TIME=${TIME} >> ${GITHUB_ENV}
NORFW=${GITHUB_WORKSPACE}/output/images/openipc.${{matrix.platform}}-nor-${{matrix.release}}.tgz
if [ -e ${NORFW} ]; then
echo NORFW=${NORFW} >> ${GITHUB_ENV}
fi
NANDFW=${GITHUB_WORKSPACE}/output/images/openipc.${{matrix.platform}}-nand-${{matrix.release}}.tgz
if [ -e ${NANDFW} ]; then
echo NANDFW=${NANDFW} >> ${GITHUB_ENV}
fi
- name: Upload firmware
if: github.event_name != 'pull_request' && matrix.custom != 'onlyci'
uses: softprops/action-gh-release@v1
with:
tag_name: ${{env.TAG_NAME}}
files: |
${{env.NORFW}}
${{env.NANDFW}}
- name: Send binary
if: github.event_name != 'pull_request' && matrix.custom != 'onlyci' && env.NORFW
run: |
TG_MSG="Commit: ${GIT_HASH}\nBranch: ${GIT_BRANCH}\nTag: ${TAG_NAME}\nTime: ${TIME}\n\n"
TG_ICON="\xE2\x9C\x85 GitHub Actions"
TG_HEADER=$(echo -e ${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendDocument -F chat_id=${TG_CHANNEL} -F caption="${TG_HEADER}" -F document=@${NORFW})
echo Telegram response: ${HTTP}
- name: Send error
if: github.event_name != 'pull_request' && failure()
run: |
TG_WARN="Error: ${{matrix.platform}}_${{matrix.release}}\n"
TG_MSG="Commit: ${GIT_HASH}\nBranch: ${GIT_BRANCH}\nTag: ${TAG_NAME}\n\n"
TG_ICON="\xE2\x9A\xA0 GitHub Actions"
TG_HEADER=$(echo -e ${TG_WARN}${TG_MSG}${TG_ICON})
HTTP=$(curl ${TG_OPTIONS} -H "Content-Type: multipart/form-data" -X POST https://api.telegram.org/bot${TG_TOKEN}/sendMessage -F chat_id=${TG_CHANNEL} -F text="${TG_HEADER}")
echo Telegram response: ${HTTP}