-
Notifications
You must be signed in to change notification settings - Fork 162
338 lines (336 loc) · 15.7 KB
/
build_tsl0922_kernal4.4_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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
name: Build tsl0922's kernal4.4 Padavan
on:
workflow_dispatch:
inputs:
target:
type: choice
description: 'target to compile'
options:
- Gee_B70
- Nokia-Sbell_A-040W-Q
- Xiaomi_CR6606
- Xiaomi_CR6608
- Xiaomi_CR6609
- DLINK_DIR-878
- DLINK_DIR-882
- JCG_836PRO
- JCG_AC860M
- JCQ_Q20
- JCQ_Q10Pro
- JCG_Y2
- Phicomm_K2P-USB
- Phicomm_K2P
- Xiaomi_4
- Xiaomi_R3G
- Xiaomi_R3P-PB
- Xiaomi_R3P
- Motorola_MR2600
- Raisecom_MSG1500_X.00
- Diting_NEWIFI3
- Xiaomi_AC2100
- Redmi_AC2100
- Asus_RT-AC85P
- Youhua_WR1200JS
- Youhua_WR330
- Xiaoyu_C1
- Xiaoyu_C3
- Xiaoyu_C5
- ZTE_E8820S
default: Xiaoyu_C1
plugins:
description: 'json format string of include configs'
required: true
default: '{"vpnsvr":"n","vpncli":"n","vpncmd":"n","ss":"n","v2ray":"n","xray":"n","trojan":"n","singbox":"n","naiveproxy":"n","ssobfs":"n","dnsforwarder":"n","adbyby":"n","adguardhome":"n","smartdns":"n","aliddns":"n","zerotier":"n","ddnsto":"n","wireguard":"n","frpc":"y","aldrive":"n","sqm":"y","mentohust":"n","scutclient":"n","njitclient":"n","minieap":"n","dogcom":"n","transmission":"n","aria":"n","ariaweb":"n"}'
firmwarever:
description: 'firmware''s version'
required: true
default: '20240209'
env:
REPOSITORY_URL: https://github.com/tsl0922/padavan.git
WORK_PATH: /opt/padavan-4.4
TIME_ZONE: Asia/Shanghai
FIRMWARE_DATEPREFIX: $(date +"%Y%m%d")
FIRMWARE_AUTHOR: tsl0922
FIRMWARE_PATH: /opt/firmwares
jobs:
build:
runs-on: ubuntu-22.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- uses: actions/checkout@v4
- uses: hendrikmuhs/[email protected]
- uses: Bonnie2980/variable-mapper@master
id: export
with:
key: "${{ github.event.inputs.target }}"
map: |
{
"Gee_B70": {
"model": "B70"
},
"Nokia-Sbell_A-040W-Q": {
"model": "BELL-A040WQ"
},
"Xiaomi_CR6606": {
"model": "CR660x"
},
"Xiaomi_CR6608": {
"model": "CR660x"
},
"Xiaomi_CR6609": {
"model": "CR660x"
},
"DLINK_DIR-878": {
"model": "DIR-878"
},
"DLINK_DIR-882": {
"model": "DIR-882"
},
"JCG_836PRO": {
"model": "JCG-836PRO"
},
"JCG_AC860M": {
"model": "JCG-AC860M"
},
"JCQ_Q20": {
"model": "JCG-Q20"
},
"JCQ_Q10Pro": {
"model": "JCG-Q20"
},
"JCG_Y2": {
"model": "JCG-Y2"
},
"Phicomm_K2P-USB": {
"model": "K2P-USB"
},
"Phicomm_K2P": {
"model": "K2P"
},
"Xiaomi_4": {
"model": "MI-4"
},
"Xiaomi_R3G": {
"model": "MI-R3G"
},
"Xiaomi_R3P-PB": {
"model": "MI-R3P-PB"
},
"Xiaomi_R3P": {
"model": "MI-R3P"
},
"Motorola_MR2600": {
"model": "MR2600"
},
"Raisecom_MSG1500_X.00": {
"model": "MSG1500"
},
"Diting_NEWIFI3": {
"model": "NEWIFI3"
},
"Xiaomi_AC2100": {
"model": "R2100"
},
"Redmi_AC2100": {
"model": "RM2100"
},
"Asus_RT-AC85P": {
"model": "RT-AC85P"
},
"Youhua_WR1200JS": {
"model": "WR1200JS"
},
"Youhua_WR330": {
"model": "WR1200JS"
},
"Xiaoyu_C1": {
"model": "XY-C1"
},
"Xiaoyu_C3": {
"model": "XY-C1"
},
"Xiaoyu_C5": {
"model": "XY-C1"
},
"ZTE_E8820S": {
"model": "ZTE-E8820S"
},
".*": {
"model": "K2P"
}
}
export_to: env
mode: first_match
- uses: actions/setup-go@v5
with:
go-version: '1.20'
check-latest: true
cache: false
- uses: actions/setup-node@v4
with:
node-version: 18
check-latest: true
- 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 python3-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 libev-dev
sudo timedatectl set-timezone "$TIME_ZONE"
- name: Clone source code
run: |
git clone --depth=1 $REPOSITORY_URL $WORK_PATH
cd $WORK_PATH
sed -i '/cp -f/d' Makefile
- name: Parse json string of include plugins
run: |
echo "vpnsvr=${{fromJson(github.event.inputs.plugins).vpnsvr}}" >> $GITHUB_ENV
echo "vpncli=${{fromJson(github.event.inputs.plugins).vpncli}}" >> $GITHUB_ENV
echo "vpncmd=${{fromJson(github.event.inputs.plugins).vpncmd}}" >> $GITHUB_ENV
echo "ss=${{fromJson(github.event.inputs.plugins).ss}}" >> $GITHUB_ENV
echo "v2ray=${{fromJson(github.event.inputs.plugins).v2ray}}" >> $GITHUB_ENV
echo "xray=${{fromJson(github.event.inputs.plugins).xray}}" >> $GITHUB_ENV
echo "trojan=${{fromJson(github.event.inputs.plugins).trojan}}" >> $GITHUB_ENV
echo "singbox=${{fromJson(github.event.inputs.plugins).singbox}}" >> $GITHUB_ENV
echo "naiveproxy=${{fromJson(github.event.inputs.plugins).naiveproxy}}" >> $GITHUB_ENV
echo "ssobfs=${{fromJson(github.event.inputs.plugins).ssobfs}}" >> $GITHUB_ENV
echo "dnsforwarder=${{fromJson(github.event.inputs.plugins).dnsforwarder}}" >> $GITHUB_ENV
echo "adbyby=${{fromJson(github.event.inputs.plugins).adbyby}}" >> $GITHUB_ENV
echo "adguardhome=${{fromJson(github.event.inputs.plugins).adguardhome}}" >> $GITHUB_ENV
echo "smartdns=${{fromJson(github.event.inputs.plugins).smartdns}}" >> $GITHUB_ENV
echo "aliddns=${{fromJson(github.event.inputs.plugins).aliddns}}" >> $GITHUB_ENV
echo "zerotier=${{fromJson(github.event.inputs.plugins).zerotier}}" >> $GITHUB_ENV
echo "ddnsto=${{fromJson(github.event.inputs.plugins).ddnsto}}" >> $GITHUB_ENV
echo "wireguard=${{fromJson(github.event.inputs.plugins).wireguard}}" >> $GITHUB_ENV
echo "frpc=${{fromJson(github.event.inputs.plugins).frpc}}" >> $GITHUB_ENV
echo "aldrive=${{fromJson(github.event.inputs.plugins).aldrive}}" >> $GITHUB_ENV
echo "sqm=${{fromJson(github.event.inputs.plugins).sqm}}" >> $GITHUB_ENV
echo "mentohust=${{fromJson(github.event.inputs.plugins).mentohust}}" >> $GITHUB_ENV
echo "scutclient=${{fromJson(github.event.inputs.plugins).scutclient}}" >> $GITHUB_ENV
echo "njitclient=${{fromJson(github.event.inputs.plugins).njitclient}}" >> $GITHUB_ENV
echo "minieap=${{fromJson(github.event.inputs.plugins).minieap}}" >> $GITHUB_ENV
echo "dogcom=${{fromJson(github.event.inputs.plugins).dogcom}}" >> $GITHUB_ENV
echo "transmission=${{fromJson(github.event.inputs.plugins).transmission}}" >> $GITHUB_ENV
echo "aria=${{fromJson(github.event.inputs.plugins).aria}}" >> $GITHUB_ENV
echo "ariaweb=${{fromJson(github.event.inputs.plugins).ariaweb}}" >> $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 '/CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_SERVER/d' .config #删除配置项SOFTETHERVPN
sed -i '/CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_CLIENT/d' .config #删除配置项SOFTETHERVPN
sed -i '/CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_CMD/d' .config #删除配置项SOFTETHERVPN
sed -i '/CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS/d' .config #删除配置项SS plus+
sed -i '/CONFIG_FIRMWARE_INCLUDE_SSSERVER/d' .config #删除配置项SS server
sed -i '/CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER/d' .config #删除配置项DNSFORWARDER
sed -i '/CONFIG_FIRMWARE_INCLUDE_ADBYBY/d' .config #删除配置项adbyby plus+
sed -i '/CONFIG_FIRMWARE_INCLUDE_TUNSAFE/d' .config #删除配置项tunsafe
sed -i '/CONFIG_FIRMWARE_INCLUDE_ALIDDNS/d' .config #删除配置项阿里DDNS
sed -i '/CONFIG_FIRMWARE_INCLUDE_SRELAY/d' .config #删除配置项srelay
sed -i '/CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME/d' .config #删除配置项adguardhome
sed -i '/CONFIG_FIRMWARE_INCLUDE_SMARTDNS/d' .config #删除配置项smartdns
sed -i '/CONFIG_FIRMWARE_INCLUDE_ZEROTIER/d' .config #删除配置项zerotier
sed -i '/CONFIG_FIRMWARE_INCLUDE_DDNSTO/d' .config #删除配置项ddnsto
sed -i '/CONFIG_FIRMWARE_INCLUDE_WIREGUARD/d' .config #删除配置项wireguard
sed -i '/CONFIG_FIRMWARE_INCLUDE_FRPS/d' .config #删除配置项frp server
sed -i '/CONFIG_FIRMWARE_INCLUDE_FRPC/d' .config #删除配置项frp client
sed -i '/CONFIG_FIRMWARE_INCLUDE_ALDRIVER/d' .config #删除配置项阿里云盘
sed -i '/CONFIG_FIRMWARE_INCLUDE_SQM/d' .config #删除配置项QOS流控
sed -i '/CONFIG_FIRMWARE_INCLUDE_TRANSMISSION/d' .config #删除配置项Transmission
sed -i '/CONFIG_FIRMWARE_INCLUDE_ARIA/d' .config #删除配置项Aria
sed -i '/CONFIG_FIRMWARE_INCLUDE_ARIA_WEB_CONTROL/d' .config #删除配置项AriaWebControl
#校园网相关开始
sed -i '/CONFIG_FIRMWARE_INCLUDE_MENTOHUST/d' .config #删除配置项MENTOHUST
sed -i '/CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT/d' .config #删除配置项SCUTCLIENT
sed -i '/CONFIG_FIRMWARE_INCLUDE_NJIT_CLIENT/d' .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_MINIEAP/d' .config
sed -i '/CONFIG_FIRMWARE_INCLUDE_DOGCOM/d' .config
#校园网相关结束
sed -i 's/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=n/CONFIG_FIRMWARE_INCLUDE_OPENSSL_EXE=y/g' .config
######################################################################
#以下选项是定义你需要的功能(y=集成,n=忽略),重新写入到.config文件
######################################################################
echo "CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_SERVER=${{env.vpnsvr}}" >> .config #SOFTETHERVPN
echo "CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_CLIENT=${{env.vpncli}}" >> .config #SOFTETHERVPN
echo "CONFIG_FIRMWARE_INCLUDE_SOFTETHERVPN_CMD=${{env.vpncmd}}" >> .config #SOFTETHERVPN
#科学相关
echo "CONFIG_FIRMWARE_INCLUDE_SHADOWSOCKS=${{env.ss}}" >> .config #SS plus+
echo "CONFIG_FIRMWARE_INCLUDE_V2RAY=${{env.v2ray}}" >> .config #集成v2ray执行文件(3.8M左右)
echo "CONFIG_FIRMWARE_INCLUDE_XRAY=${{env.xray}}" >> .config #集成xray执行文件(5.6M左右),可以代替v2ray,注:如果闪存太小不够还是建议使用v2ray
echo "CONFIG_FIRMWARE_INCLUDE_TROJAN=${{env.trojan}}" >> .config #集成trojan执行文件(1.1M左右)
echo "CONFIG_FIRMWARE_INCLUDE_SINGBOX=${{env.singbox}}" >> .config #集成Singbox执行文件
echo "CONFIG_FIRMWARE_INCLUDE_NAIVEPROXY=${{env.naiveproxy}}" >> .config #集成Naiveproxy执行文件
echo "CONFIG_FIRMWARE_INCLUDE_SSOBFS=${{env.ssobfs}}" >> .config # simple-obfs混淆插件
echo "CONFIG_FIRMWARE_INCLUDE_SSSERVER=n" >> .config #SS server
#
echo "CONFIG_FIRMWARE_INCLUDE_SRELAY=n" >> .config #可以不集成
echo "CONFIG_FIRMWARE_INCLUDE_TUNSAFE=n" >> .config #tunsafe
echo "CONFIG_FIRMWARE_INCLUDE_DNSFORWARDER=${{env.dnsforwarder}}" >> .config #dnsforwarder
#
echo "CONFIG_FIRMWARE_INCLUDE_ADBYBY=${{env.adbyby}}" >> .config #adbyby plus+
#
echo "CONFIG_FIRMWARE_INCLUDE_ADGUARDHOME=${{env.adguardhome}}" >> .config #adguardhome
echo "CONFIG_FIRMWARE_INCLUDE_SMARTDNS=${{env.smartdns}}" >> .config #smartdns
#
echo "CONFIG_FIRMWARE_INCLUDE_ALIDDNS=${{env.aliddns}}" >> .config #阿里DDNS
echo "CONFIG_FIRMWARE_INCLUDE_ZEROTIER=${{env.zerotier}}" >> .config #zerotier ~1.3M
echo "CONFIG_FIRMWARE_INCLUDE_DDNSTO=${{env.ddnsto}}" >> .config #ddnsto
echo "CONFIG_FIRMWARE_INCLUDE_WIREGUARD=${{env.wireguard}}" >> .config #wireguard
echo "CONFIG_FIRMWARE_INCLUDE_FRPS=n" >> .config #frp server
echo "CONFIG_FIRMWARE_INCLUDE_FRPC=${{env.frpc}}" >> .config #frp client
#
echo "CONFIG_FIRMWARE_INCLUDE_ALDRIVER=${{env.aldrive}}" >> .config #阿里云盘
echo "CONFIG_FIRMWARE_INCLUDE_SQM=${{env.sqm}}" >> .config #QOS流控
#
#
echo "CONFIG_FIRMWARE_INCLUDE_TRANSMISSION=${{env.transmission}}" >> .config #Transmission
echo "CONFIG_FIRMWARE_INCLUDE_ARIA=${{env.aria}}" >> .config #Aria
echo "CONFIG_FIRMWARE_INCLUDE_ARIA_WEB_CONTROL=${{env.ariaweb}}" >> .config #Aria Web
#
#校园网相关开始
#echo "CONFIG_FIRMWARE_INCLUDE_MENTOHUST=${{env.mentohust}}" >> .config #MENTOHUST
#echo "CONFIG_FIRMWARE_INCLUDE_SCUTCLIENT=${{env.scutclient}}" >> .config #SCUTCLIENT
#echo "CONFIG_FIRMWARE_INCLUDE_NJIT_CLIENT=${{env.njitclient}}" >> .config
#echo "CONFIG_FIRMWARE_INCLUDE_MINIEAP=${{env.minieap}}" >> .config
#echo "CONFIG_FIRMWARE_INCLUDE_DOGCOM=${{env.dogcom}}" >> .config
#校园网相关结束
#########################################################################################
#自定义添加其它功能请参考源码configs/templates/目录下的config文件。按照上面的格式添加即可
#格式如下:
#sed -i '/自定义项/d' .config
#echo "自定义项=y" >> .config
sed -i "s/FIRMWARE_BUILDS_REV=.*/FIRMWARE_BUILDS_REV=${{ github.event.inputs.firmwarever }}/g" ./versions.inc
echo '更新版本号时间'
#########################################################################################
- name: Build firmware
run: |
cd $WORK_PATH
sudo make ${{ env.model }} TOOLCHAIN=mipsel-linux-musl
echo "FIRMWARE_DATEPREFIX=$(date +"%Y%m%d")" >> $GITHUB_ENV
- 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 }}"_kernal4.4.trx"
done
cd $FIRMWARE_PATH
echo "FIRMWARE=$PWD" >> $GITHUB_ENV
echo "STATUS=success" >> $GITHUB_ENV
- name : Upload packages
uses: actions/upload-artifact@main
if: env.STATUS == 'success'
with:
name: tsl0922-Padavan44-packages
path: ${{ env.FIRMWARE }}