forked from OpenIPC/firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
229 lines (193 loc) · 8.65 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
name: build
on:
pull_request:
branches:
- master
push:
branches:
- master
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
env:
TAG_NAME: latest
jobs:
buildroot:
name: Firmware
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
# Sigmastar [I6]
- {"platform": "ssc325", "release": "lite"}
- {"platform": "ssc325de", "release": "lite"}
# Sigmastar [I6B]
- {"platform": "ssc333", "release": "lite"}
- {"platform": "ssc333", "release": "ultimate"}
- {"platform": "ssc335", "release": "lite"}
- {"platform": "ssc335", "release": "ultimate"}
- {"platform": "ssc335de", "release": "lite"}
- {"platform": "ssc335de", "release": "ultimate"}
- {"platform": "ssc337", "release": "lite"}
- {"platform": "ssc337", "release": "ultimate"}
- {"platform": "ssc337de", "release": "lite"}
- {"platform": "ssc337de", "release": "ultimate"}
# Sigmastar [I6C]
- {"platform": "ssc377", "release": "lite"}
# Sigmastar [I6E]
- {"platform": "ssc30kd", "release": "lite"}
- {"platform": "ssc30kd", "release": "ultimate"}
- {"platform": "ssc30kq", "release": "fpv"}
- {"platform": "ssc30kq", "release": "lite"}
- {"platform": "ssc30kq", "release": "ultimate"}
- {"platform": "ssc338q", "release": "fpv"}
- {"platform": "ssc338q", "release": "lite"}
- {"platform": "ssc338q", "release": "ultimate"}
# Ingenic [T21]
- {"platform": "t10", "release": "lite"}
- {"platform": "t20", "release": "lite"}
- {"platform": "t20", "release": "ultimate"}
- {"platform": "t21", "release": "lite"}
- {"platform": "t21", "release": "ultimate"}
- {"platform": "t30", "release": "lite"}
# Ingenic [T31]
- {"platform": "t31", "release": "lite"}
- {"platform": "t31", "release": "ultimate"}
# Ingenic [T40]
- {"platform": "t40", "release": "lite"}
- {"platform": "t40", "release": "ultimate"}
# Hisilicon [HI3516AV100]
- {"platform": "hi3516av100", "release": "lite"}
- {"platform": "hi3516av100", "release": "ultimate"}
- {"platform": "hi3516dv100", "release": "lite"}
- {"platform": "hi3516dv100", "release": "ultimate"}
# Hisilicon [HI3516CV100]
- {"platform": "hi3516cv100", "release": "lite"}
- {"platform": "hi3518cv100", "release": "lite"}
- {"platform": "hi3518ev100", "release": "lite"}
# Hisilicon [HI3516CV200]
- {"platform": "hi3516cv200", "release": "lite"}
- {"platform": "hi3518ev200", "release": "mini"}
- {"platform": "hi3518ev200", "release": "lite"}
- {"platform": "hi3518ev200", "release": "ultimate"}
# Hisilicon [HI3516CV300]
- {"platform": "hi3516cv300", "release": "mini"}
- {"platform": "hi3516cv300", "release": "lite"}
- {"platform": "hi3516cv300", "release": "ultimate"}
- {"platform": "hi3516ev100", "release": "lite"}
# Hisilicon [HI3516CV500]
- {"platform": "hi3516av300", "release": "lite"}
- {"platform": "hi3516cv500", "release": "lite"}
- {"platform": "hi3516dv300", "release": "lite"}
# Hisilicon [HI3516EV200]
- {"platform": "hi3516dv200", "release": "lite"}
- {"platform": "hi3516ev200", "release": "lte"}
- {"platform": "hi3516ev200", "release": "fpv"}
- {"platform": "hi3516ev200", "release": "lite"}
- {"platform": "hi3516ev200", "release": "ultimate"}
- {"platform": "hi3516ev300", "release": "lte"}
- {"platform": "hi3516ev300", "release": "fpv"}
- {"platform": "hi3516ev300", "release": "lite"}
- {"platform": "hi3516ev300", "release": "ultimate"}
- {"platform": "hi3518ev300", "release": "lite"}
- {"platform": "hi3518ev300", "release": "ultimate"}
# Hisilicon [HI3519V101]
- {"platform": "hi3516av200", "release": "lite"}
- {"platform": "hi3516av200", "release": "ultimate"}
- {"platform": "hi3519v101", "release": "lite"}
# Hisilicon [HI3536CV100]
- {"platform": "hi3536cv100", "release": "lite"}
# Hisilicon [HI3536DV100]
- {"platform": "hi3536dv100", "release": "fpv"}
- {"platform": "hi3536dv100", "release": "lite"}
# Goke [GK710X]
- {"platform": "gk7102", "release": "lite"}
- {"platform": "gk7102s", "release": "lite"}
# Goke [GK7205V200]
- {"platform": "gk7202v300", "release": "lite"}
- {"platform": "gk7205v200", "release": "lte"}
- {"platform": "gk7205v200", "release": "fpv"}
- {"platform": "gk7205v200", "release": "venc"}
- {"platform": "gk7205v200", "release": "lite"}
- {"platform": "gk7205v200", "release": "ultimate"}
- {"platform": "gk7205v210", "release": "fpv"}
- {"platform": "gk7205v210", "release": "venc"}
- {"platform": "gk7205v210", "release": "lite"}
- {"platform": "gk7205v300", "release": "lte"}
- {"platform": "gk7205v300", "release": "fpv"}
- {"platform": "gk7205v300", "release": "venc"}
- {"platform": "gk7205v300", "release": "lite"}
- {"platform": "gk7205v300", "release": "ultimate"}
- {"platform": "gk7605v100", "release": "lite"}
# Fullhan
- {"platform": "fh8852v100", "release": "lite"}
- {"platform": "fh8852v200", "release": "lite"}
# Grainmedia
- {"platform": "gm8136", "release": "lite"}
# Novatek
- {"platform": "nt98562", "release": "lite"}
- {"platform": "nt98566", "release": "lite"}
# Rockchip
- {"platform": "rv1109", "release": "lite"}
- {"platform": "rv1126", "release": "lite"}
# Xiongmai
- {"platform": "xm510", "release": "lite"}
- {"platform": "xm530", "release": "lite"}
- {"platform": "xm550", "release": "lite"}
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Prepare firmware
run: |
echo CACHE_DATE=$(date +%m) >> ${GITHUB_ENV}
make BOARD=${{matrix.platform}}_${{matrix.release}} br-source
- name: Setup ccache
if: github.event_name != 'pull_request'
uses: actions/cache@v4
with:
path: /tmp/ccache
key: ${{matrix.platform}}_${{matrix.release}}-${{env.CACHE_DATE}}
- name: Restore ccache
if: github.event_name == 'pull_request'
uses: actions/cache/restore@v4
with:
path: /tmp/ccache
key: ${{matrix.platform}}_${{matrix.release}}-${{env.CACHE_DATE}}
- 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}}
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'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{env.TAG_NAME}}
files: |
${{env.NORFW}}
${{env.NANDFW}}
- name: Send binary
if: github.event_name != 'pull_request' && 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})
TG_TOKEN=${{secrets.TELEGRAM_TOKEN_BOT_OPENIPC}}
TG_CHANNEL=${{secrets.TELEGRAM_CHANNEL_OPENIPC_DEV}}
HTTP=$(curl -s -o /dev/null -w %{http_code} https://api.telegram.org/bot${TG_TOKEN}/sendDocument -F chat_id=${TG_CHANNEL} -F caption="${TG_HEADER}" -F document=@${NORFW})
echo Telegram response: ${HTTP}