forked from coolsnowwolf/lede
-
Notifications
You must be signed in to change notification settings - Fork 0
222 lines (194 loc) · 7.11 KB
/
openwrt-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
#
# This is free software, lisence use MIT.
#
# Copyright (C) 2019 P3TERX <https://p3terx.com>
# Copyright (C) 2019 KFERMercer <[email protected]>
#
# <https://github.com/KFERMercer/OpenWrt-CI>
#
name: OpenWrt-CI
on:
push:
branches:
- master
# schedule:
# - cron: 0 20 * * *
# release:
# types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
ref: master
- name: Initialization environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
echo "Deleting files, please wait ..."
sudo rm -rf \
/usr/share/dotnet \
/etc/mysql \
/etc/php
sudo -E apt-get -y purge \
azure-cli \
ghc* \
zulu* \
hhvm \
llvm* \
firefox \
google* \
dotnet* \
powershell \
openjdk* \
mysql* \
php*
sudo -E apt-get update
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
- name: Update feeds
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: Costom configure file
run: |
rm -f ./.config*
touch ./.config
#
# ========================固件定製部分========================
#
#
# 如果不對本區塊做出任何編輯, 則生成默認配置固件.
#
# 以下為定製化固件選項和說明:
#
#
# 有些插件/選項是默認開啟的, 如果想要關閉, 請參照以下示例進行編寫:
#
# =========================================
# | # 取消編譯VMware鏡像: |
# | cat >> .config <<EOF |
# | # CONFIG_VMDK_IMAGES is not set |
# | EOF |
# =========================================
#
#
# 以下是一些提前準備好的一些插件選項.
# 直接取消註釋相應代碼塊即可應用. 不要取消註釋代碼塊上的漢字說明.
# 如果不需要代碼塊裡的某一項配置, 只需要刪除相應行.
#
# 如果需要其他插件, 請按照示例自行添加.
# 注意, 只需添加依賴鏈頂端的包. 如果你需要插件 A, 同時 A 依賴 B, 即只需要添加 A.
#
# 無論你想要對固件進行怎樣的定製, 都需要且只需要修改 EOF 迴環內的內容.
#
# 編譯x64固件:
# cat >> .config <<EOF
# CONFIG_TARGET_x86=y
# CONFIG_TARGET_x86_64=y
# CONFIG_TARGET_x86_64_Generic=y
# EOF
# 固件壓縮:
# cat >> .config <<EOF
# CONFIG_TARGET_IMAGES_GZIP=y
# EOF
# 編譯UEFI固件:
# cat >> .config <<EOF
# CONFIG_EFI_IMAGES=y
# EOF
# IPv6支持:
# cat >> .config <<EOF
# CONFIG_PACKAGE_dnsmasq_full_dhcpv6=y
# CONFIG_PACKAGE_ipv6helper=y
# EOF
# 多文件系統支持:
# cat >> .config <<EOF
# CONFIG_PACKAGE_kmod-fs-nfs=y
# CONFIG_PACKAGE_kmod-fs-nfs-common=y
# CONFIG_PACKAGE_kmod-fs-nfs-v3=y
# CONFIG_PACKAGE_kmod-fs-nfs-v4=y
# CONFIG_PACKAGE_kmod-fs-ntfs=y
# CONFIG_PACKAGE_kmod-fs-squashfs=y
# EOF
# USB3.0支持:
# cat >> .config <<EOF
# CONFIG_PACKAGE_kmod-usb-ohci=y
# CONFIG_PACKAGE_kmod-usb-ohci-pci=y
# CONFIG_PACKAGE_kmod-usb2=y
# CONFIG_PACKAGE_kmod-usb2-pci=y
# CONFIG_PACKAGE_kmod-usb3=y
# EOF
# 常用LuCI插件選擇:
# cat >> .config <<EOF
# CONFIG_PACKAGE_luci-app-adbyby-plus=y
# CONFIG_PACKAGE_luci-app-aria2=y
# CONFIG_PACKAGE_luci-app-baidupcs-web=y
# CONFIG_PACKAGE_luci-app-docker=y
# CONFIG_PACKAGE_luci-app-frpc=y
# CONFIG_PACKAGE_luci-app-hd-idle=y
# CONFIG_PACKAGE_luci-app-kodexplorer=y
# CONFIG_PACKAGE_luci-app-minidlna=y
# CONFIG_PACKAGE_luci-app-openvpn=y
# CONFIG_PACKAGE_luci-app-openvpn-server=y
# CONFIG_PACKAGE_luci-app-qbittorrent=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Kcptun=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_Shadowsocks=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Server=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_ShadowsocksR_Socks=y
# CONFIG_PACKAGE_luci-app-ssr-plus_INCLUDE_V2ray=y
# CONFIG_PACKAGE_luci-app-ttyd=y
# CONFIG_PACKAGE_luci-app-v2ray-server=y
# CONFIG_PACKAGE_luci-app-verysync=y
# CONFIG_PACKAGE_luci-app-webadmin=y
# CONFIG_PACKAGE_luci-app-wireguard=y
# CONFIG_PACKAGE_luci-app-wrtbwmon=y
# EOF
# LuCI主題:
# cat >> .config <<EOF
# CONFIG_PACKAGE_luci-theme-argon=y
# CONFIG_PACKAGE_luci-theme-netgear=y
# EOF
# 常用軟件包:
# cat >> .config <<EOF
# CONFIG_PACKAGE_curl=y
# CONFIG_PACKAGE_htop=y
# CONFIG_PACKAGE_nano=y
# CONFIG_PACKAGE_screen=y
# CONFIG_PACKAGE_tree=y
# CONFIG_PACKAGE_vim-fuller=y
# CONFIG_PACKAGE_wget=y
# EOF
# 取消編譯VMware鏡像以及鏡像填充 (不要刪除被縮進的註釋符號):
# cat >> .config <<EOF
# # CONFIG_TARGET_IMAGES_PAD is not set
# # CONFIG_VMDK_IMAGES is not set
# EOF
#
# ========================固件定製部分結束========================
#
sed -i 's/^[ \t]*//g' ./.config
make defconfig
- name: Make download
run: |
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Compile firmware
run: |
echo -e "$(nproc) thread build."
make -j$(nproc) V=s
- name: Assemble artifact
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
find ./bin/targets/ -name "*combined*img*" | xargs -i mv -f {} ./artifact/
find ./bin/targets/ -name "*sysupgrade*bin*" | xargs -i mv -f {} ./artifact/
- name: Upload artifact
uses: actions/upload-artifact@master
with:
name: OpenWrt firmware
path: ./artifact/