-
Notifications
You must be signed in to change notification settings - Fork 162
280 lines (278 loc) · 8.23 KB
/
build_hanwckf_kernal3.x_padavan.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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
name: Build hanwckf's kernal3.x Padavan
on:
workflow_dispatch:
inputs:
target:
type: choice
description: 'target to compile'
options:
- Phicomm_K1
- Phicomm_K2
- Oyewifi_OYE-0001
- Lenovo_NEWIFI-MINI
- Xiaomi_MINI
- Xiaomi_3
- Xiaomi_3C
- Xiaomi_4
- Xiaomi_R3G
- Xiaomi_R4A
- Xiaomi_R3P
- Gee_HiWifi1S
- Gee_HiWifi2
- Gee_Enjoy1200
- Qihoo_360P2
- Xiaomi_NANO
- Meizu_R13
- Meizu_R13P
- Asus_RT-AC1200GU
- Xiaoyu_C1
- Xiaoyu_C3
- Xiaoyu_C5
- Youhua_WR1200JS
- Diting_NEWIFI3
- Gee_B70
- Totolink_A3004NS
- Phicomm_K2P
- Phicomm_K2P-USB
- JCG_836PRO
- JCG_AC860M
- DLINK_DIR-882
- DLINK_DIR-878
- Motorola_MR2600
- TP-LINK_WDR7300
- Redmi_AC2100
- Xiaomi_CR6606
- Xiaomi_CR6608
- Xiaomi_CR6609
- Xiaomi_AC2100
- JCG_Y2
- ZTE_E8820V2
- ZTE_E8820S
- Raisecom_MSG1500_X.00
- Netgear_R6220
uploadanon:
type: boolean
description: 'upload firmware to anonfiles'
default: 'false'
env:
REPOSITORY_URL: https://github.com/hanwckf/rt-n56u.git
TOOLCHAIN_URL: https://github.com/hanwckf/padavan-toolchain/releases/download/v1.1/mipsel-linux-uclibc.tar.xz
WORK_PATH: /opt/rt-n56u
TIME_ZONE: Asia/Shanghai
FIRMWARE_AUTHOR: hanwckf
FIRMWARE_PATH: /opt/firmwares
jobs:
build:
runs-on: ubuntu-20.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- uses: actions/checkout@v4
- uses: Bonnie2980/variable-mapper@master
id: export
with:
key: "${{ github.event.inputs.target }}"
map: |
{
"Phicomm_K1": {
"model": "PSG1208"
},
"Phicomm_K2": {
"model": "PSG1218"
},
"Oyewifi_OYE-0001": {
"model": "OYE-001"
},
"Lenovo_NEWIFI-MINI": {
"model": "NEWIFI-MINI"
},
"Xiaomi_MINI": {
"model": "MI-MINI"
},
"Xiaomi_3": {
"model": "MI-3"
},
"Xiaomi_3C": {
"model": "MI-3C"
},
"Xiaomi_4": {
"model": "MI-4"
},
"Xiaomi_R3G": {
"model": "MI-R3G"
},
"Xiaomi_R4A": {
"model": "MI-R4A"
},
"Xiaomi_R3P": {
"model": "MI-R3P"
},
"Gee_HiWifi1S": {
"model": "HC5661A"
},
"Gee_HiWifi2": {
"model": "HC5761A"
},
"Gee_Enjoy1200": {
"model": "HC5861B"
},
"Qihoo_360P2": {
"model": "360P2"
},
"Xiaomi_NANO": {
"model": "MI-NANO"
},
"Meizu_R13": {
"model": "MZ-R13"
},
"Meizu_R13P": {
"model": "MZ-R13P"
},
"Asus_RT-AC1200GU": {
"model": "RT-AC1200GU"
},
"Xiaoyu_C1": {
"model": "XY-C1"
},
"Xiaoyu_C3": {
"model": "XY-C1"
},
"Xiaoyu_C5": {
"model": "XY-C1"
},
"Youhua_WR1200JS": {
"model": "WR1200JS"
},
"Diting_NEWIFI3": {
"model": "NEWIFI3"
},
"Gee_B70": {
"model": "B70"
},
"Totolink_A3004NS": {
"model": "A3004NS"
},
"Phicomm_K2P": {
"model": "K2P"
},
"Phicomm_K2P-USB": {
"model": "K2P-USB"
},
"JCG_836PRO": {
"model": "JCG-836PRO"
},
"JCG_AC860M": {
"model": "JCG-AC860M"
},
"DLINK_DIR-882": {
"model": "DIR-882"
},
"DLINK_DIR-878": {
"model": "DIR-878"
},
"Motorola_MR2600": {
"model": "MR2600"
},
"TP-LINK_WDR7300": {
"model": "WDR7300"
},
"Redmi_AC2100": {
"model": "RM2100"
},
"Xiaomi_CR6606": {
"model": "CR660x"
},
"Xiaomi_CR6608": {
"model": "CR660x"
},
"Xiaomi_CR6609": {
"model": "CR660x"
},
"Xiaomi_AC2100": {
"model": "R2100"
},
"JCG_Y2": {
"model": "JCG-Y2"
},
"ZTE_E8820V2": {
"model": "E8820V2"
},
"ZTE_E8820S": {
"model": "ZTE_E8820S"
},
"Raisecom_MSG1500_X.00": {
"model": "MSG1500"
},
"Netgear_R6220": {
"model": "R6220"
},
".*": {
"model": "K2P"
}
}
export_to: env
mode: first_match
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo apt-get update
sudo apt install unzip libtool-bin curl cmake gperf gawk flex bison nano xxd fakeroot kmod \
cpio git python-docutils gettext automake autopoint texinfo build-essential help2man \
pkg-config zlib1g-dev libgmp3-dev libmpc-dev libmpfr-dev libncurses5-dev libltdl-dev wget libc-dev-bin
sudo timedatectl set-timezone "$TIME_ZONE"
- name: Clone source code
run: |
git clone --depth=1 $REPOSITORY_URL $WORK_PATH
cd $WORK_PATH/toolchain-mipsel
mkdir -p toolchain-3.4.x
wget $TOOLCHAIN_URL
tar -xvf mipsel-linux-uclibc.tar.xz -C toolchain-3.4.x
- name: Set environment variables
run: |
git config --global log.date format:'%Y%m%d'
cd $WORK_PATH
echo "FIRMWARE_VERSION=$(git log -1 --pretty=format:"%cd")" >> $GITHUB_ENV
echo "FIRMWARE_DATEPREFIX=$(date +"%Y%m%d")" >> $GITHUB_ENV
- name: Custom config
run: |
cd $WORK_PATH/trunk
if [ ! -f configs/templates/${{ env.model }}.config ] ; then
echo "configs/templates/${{ env.model }}.config not found"
exit 1
fi
cp -f configs/templates/${{ env.model }}.config .config
sed -i "s/FIRMWARE_BUILDS_REV=.*/FIRMWARE_BUILDS_REV=${FIRMWARE_VERSION}/g" ./versions.inc
- name: Build firmware
run: |
cd $WORK_PATH/trunk
./clear_tree
fakeroot ./build_firmware_modify ${{ env.model }}
- name: Organize firmware files
id: organize
run: |
mkdir -p $FIRMWARE_PATH/
cd $WORK_PATH/trunk/images
for firmwarefile in $(ls *.trx)
do sudo mv $firmwarefile $FIRMWARE_PATH/${FIRMWARE_DATEPREFIX}"_"${FIRMWARE_AUTHOR}"_"${{ env.model }}"_kernal3.x.trx"
done
cd $FIRMWARE_PATH
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
echo "STATUS=success" >> $GITHUB_ENV
- name : Upload packages
uses: actions/upload-artifact@master
if: env.STATUS == 'success'
with:
name: Padavan-packages
path: ${{ env.FIRMWARE }}
- name: Upload firmware to anonfiles
if: env.STATUS == 'success' && github.event.inputs.uploadanon == 'true'
run: |
curl -fsSL git.io/file-transfer | sh
./transfer anon --no-progress ${FIRMWARE} 2>&1 | tee anonfile.log
echo "::warning file=anonfile.com::$(cat anonfile.log | grep -o -E "https?://[a-zA-Z0-9\.\/_&=@$%?~#-]*")"
- name: Remove obsolete firmwares on artifacts
uses: Bonnie2980/gha-remove-artifacts@master
if: env.STATUS == 'success'
with:
age: '1 day'
skip-recent: 5