This repository has been archived by the owner on Jan 31, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
214 lines (213 loc) · 15.3 KB
/
main.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
name: Openwrt Build Bot
on:
push:
branches: master
schedule:
- cron: 0 0 * * *
jobs:
buildpkg:
name: Build Openwrt Package
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
SDK_URL:
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ipq806x/generic/openwrt-sdk-23.05.0-rc2-ipq806x-generic_gcc-12.3.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ipq40xx/generic/openwrt-sdk-23.05.0-rc2-ipq40xx-generic_gcc-12.3.0_musl_eabi.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ramips/mt7621/openwrt-sdk-23.05.0-rc2-ramips-mt7621_gcc-12.3.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ath79/generic/openwrt-sdk-23.05.0-rc2-ath79-generic_gcc-12.3.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ath79/nand/openwrt-sdk-23.05.0-rc2-ath79-nand_gcc-12.3.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/x86/64/openwrt-sdk-23.05.0-rc2-x86-64_gcc-12.3.0_musl.Linux-x86_64.tar.xz
- https://downloads.openwrt.org/releases/23.05.0-rc2/targets/rockchip/armv8/openwrt-sdk-23.05.0-rc2-rockchip-armv8_gcc-12.3.0_musl.Linux-x86_64.tar.xz
steps:
- name: Free Disk Space
uses: jlumbroso/free-disk-space@main
with:
large-packages: false
- uses: actions/checkout@main
- name: Env for Openwrt SDK
run: sudo apt update && sudo apt install -y libev-dev libc-ares-dev libudns-dev libncurses-dev
- name: Download Openwrt SDK
env:
SDK_URL: ${{ matrix.SDK_URL }}
run: |
SDK_HOME=$(head -c -8 <<< $(basename $SDK_URL))
wget $SDK_URL
tar xf $(basename $SDK_URL) -C ~/
mv ~/$SDK_HOME ~/sdk
cp key-build ~/sdk/
- name: Download Packages
run: |
cd ~/sdk
# Shadowsocks
git clone --depth 1 -b master https://github.com/shadowsocks/luci-app-shadowsocks package/luci-app-shadowsocks
git clone --depth 1 -b master https://github.com/shadowsocks/openwrt-shadowsocks package/shadowsocks-libev
git clone --depth 1 -b master https://github.com/aa65535/openwrt-simple-obfs package/simple-obfs
# Misc
git clone --depth 1 -b master https://github.com/aa65535/openwrt-chinadns package/chinadns
git clone --depth 1 -b master https://github.com/aa65535/openwrt-dns-forwarder package/dns-forwarder
git clone --depth 1 -b master https://github.com/aa65535/openwrt-dist-luci package/openwrt-dist-luci
# Vlmcsd
git clone --depth 1 -b master https://github.com/cokebar/openwrt-vlmcsd package/vlmcsd
git clone --depth 1 -b master https://github.com/cokebar/luci-app-vlmcsd package/luci-app-vlmcsd
# Clash
git clone --depth 1 -b master https://github.com/vernesong/OpenClash package/openclash
# Smartdns
git clone --depth 1 -b master https://github.com/pymumu/openwrt-smartdns package/smartdns
git clone --depth 1 -b master https://github.com/pymumu/luci-app-smartdns package/luci-app-smartdns
sed -i 's|../../luci.mk|$(TOPDIR)/feeds/luci/luci.mk|g; 7iPKG_NAME:=luci-app-smartdns' package/luci-app-smartdns/Makefile
# Dockerman
pushd /tmp
git clone --depth 1 -b master https://github.com/lisaac/luci-lib-docker
mv luci-lib-docker/collections/luci-lib-docker ~/sdk/package/luci-lib-docker
git clone --depth 1 -b master https://github.com/lisaac/luci-app-dockerman
mv luci-app-dockerman/applications/luci-app-dockerman ~/sdk/package/luci-app-dockerman
popd
# Dependency
#git clone -b master https://github.com/shadowsocks/openwrt-feeds package/custom
pushd package/openwrt-dist-luci/tools/po2lmo ; make && sudo make install ; popd
./scripts/feeds update -a
./scripts/feeds install golang c-ares libev libopenssl libsodium mbedtls pcre libncursesw6
- name: Compile
run: |
cd ~/sdk
make defconfig
# Edit config
make V=s
- name: Upload
env:
SDK_URL: ${{ matrix.SDK_URL }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
TAG=$(sed -n 's/.*targets\/\(\w*\)\/\(\w*\)\/.*/packages\/\1\/\2/p' <<< $SDK_URL)
# Upload base only
cd ~/sdk/bin/packages/*/base
git init
git config user.name "bot"
git config user.email "bot@github.com"
git add .
git commit -m "$TAG$(TZ='Asia/Shanghai' date +@%Y%m%d)"
git push --force --quiet "https://$GITHUB_TOKEN@github.com/simonsmh/openwrt-dist.git" HEAD:$TAG
buildimg:
name: Build Openwrt Image
needs: buildpkg
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
- PROFILE: asus_rt-ac58u
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ipq40xx/generic/openwrt-imagebuilder-23.05.0-rc2-ipq40xx-generic.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates block-mount usbutils coreutils coreutils-base64 curl iperf3 ip-full kmod-ipt-tproxy kmod-nft-tproxy kmod-usb-storage-extras kmod-usb-storage-uas kmod-fs-exfat kmod-fs-vfat kmod-fs-ntfs kmod-fs-ext4 kmod-ipt-nat6 kmod-tun dosfstools ntfs-3g e2fsprogs fdisk libmbedtls luci luci-app-wireguard luci-app-samba4 luci-app-shadowsocks luci-app-smartdns luci-app-dns-forwarder stubby luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-samba4-zh-cn luci-i18n-smartdns-zh-cn mount-utils shadowsocks-libev smartdns uhttpd iperf3 mtr htop tmux nano lsblk luci-i18n-wol-zh-cn ethtool tcpdump wpad-mbedtls -wpad-basic-mbedtls dnsmasq-full -dnsmasq miniupnpd luci-app-upnp
INCLUDE_FILES: true
ROOTFS_PARTSIZE: 0
- PROFILE: asus_rt-ac58u.master
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ipq40xx/generic/openwrt-imagebuilder-23.05.0-rc2-ipq40xx-generic.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates luci luci-i18n-base-zh-cn wget curl luci-i18n-firewall-zh-cn wpad-mbedtls -wpad-basic-mbedtls coreutils-base64 lsblk fdisk tmux nano luci-i18n-wol-zh-cn openssh-client tcpdump iperf3 mtr iptables-mod-tproxy ip shadowsocks-libev luci-app-shadowsocks luci-app-chinadns stubby shadowsocks-libev-server kmod-fs-vfat kmod-fs-ext4 kmod-usb-storage-extras iptables-mod-iprange iptables-mod-hashlimit kmod-ipt-nat6 kmod-ip6tables-extra kmod-ip6-tunnel miniupnpd luci-app-upnp block-mount luci-app-wireguard
INCLUDE_FILES: false
ROOTFS_PARTSIZE: 0
- PROFILE: netgear_r6220.master
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ramips/mt7621/openwrt-imagebuilder-23.05.0-rc2-ramips-mt7621.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates luci luci-i18n-base-zh-cn wget curl luci-i18n-firewall-zh-cn wpad-mbedtls -wpad-basic-mbedtls coreutils-base64 lsblk fdisk tmux nano luci-i18n-wol-zh-cn openssh-client tcpdump iperf3 mtr iptables-mod-tproxy ip shadowsocks-libev luci-app-shadowsocks luci-app-chinadns stubby shadowsocks-libev-server kmod-fs-vfat kmod-fs-ext4 kmod-usb-storage-extras iptables-mod-iprange iptables-mod-hashlimit kmod-ipt-nat6 kmod-ip6tables-extra kmod-ip6-tunnel miniupnpd luci-app-upnp block-mount ndppd
INCLUDE_FILES: false
ROOTFS_PARTSIZE: 0
- PROFILE: netgear_r6220.relay
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ramips/mt7621/openwrt-imagebuilder-23.05.0-rc2-ramips-mt7621.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates luci luci-i18n-base-zh-cn wget curl luci-i18n-firewall-zh-cn wpad-mbedtls -wpad-basic-mbedtls coreutils-base64 lsblk fdisk tmux nano luci-i18n-wol-zh-cn openssh-client iperf3 mtr ip kmod-fs-vfat kmod-fs-ext4 kmod-usb-storage-extras block-mount
INCLUDE_FILES: false
ROOTFS_PARTSIZE: 0
- PROFILE: qihoo_c301
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ath79/generic/openwrt-imagebuilder-23.05.0-rc2-ath79-generic.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates curl luci luci-app-wireguard luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn uhttpd wpad-mbedtls -wpad-basic-mbedtls
INCLUDE_FILES: false
ROOTFS_PARTSIZE: 0
- PROFILE: qihoo_c301.relay
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ath79/generic/openwrt-imagebuilder-23.05.0-rc2-ath79-generic.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates luci luci-i18n-base-zh-cn wget curl luci-i18n-firewall-zh-cn wpad-mbedtls -wpad-basic-mbedtls coreutils-base64 lsblk fdisk tmux nano luci-i18n-wol-zh-cn openssh-client iperf3 mtr ip kmod-fs-vfat kmod-fs-ext4 kmod-usb-storage-extras block-mount
INCLUDE_FILES: false
ROOTFS_PARTSIZE: 0
- PROFILE: generic.x86_64
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/x86/64/openwrt-imagebuilder-23.05.0-rc2-x86-64.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates block-mount usbutils coreutils coreutils-base64 curl iperf3 ip-full kmod-ipt-tproxy kmod-nft-tproxy ebtables kmod-ebtables-ipv6 kmod-usb-storage-extras kmod-usb-storage-uas kmod-fs-exfat kmod-fs-vfat kmod-fs-ntfs kmod-fs-ext4 kmod-ipt-nat6 kmod-tun dosfstools ntfs-3g e2fsprogs fdisk libmbedtls luci luci-compat luci-app-wireguard luci-app-samba4 luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-samba4-zh-cn mount-utils uhttpd iperf3 mtr htop tmux nano lsblk luci-i18n-wol-zh-cn ethtool tcpdump dnsmasq-full -dnsmasq kmod-usb-net-rtl8152 kmod-usb-net-asix kmod-usb-net-asix-ax88179 mwan3 luci-app-mwan3 kmod-macvlan shadowsocks-libev luci-app-shadowsocks luci-app-openclash kmod-inet-diag openvpn-mbedtls luci-app-openvpn zerotier
INCLUDE_FILES: false
ROOTFS_PARTSIZE: 4000
- PROFILE: d-team_newifi-d2.sun
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ramips/mt7621/openwrt-imagebuilder-23.05.0-rc2-ramips-mt7621.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates block-mount usbutils coreutils curl iperf3 ip-full kmod-ipt-tproxy kmod-nft-tproxy kmod-usb-storage-extras kmod-usb-storage-uas kmod-fs-exfat kmod-fs-vfat kmod-fs-ntfs kmod-ipt-nat6 kmod-tun ntfs-3g libmbedtls luci luci-app-wireguard luci-app-samba4 luci-app-shadowsocks luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-samba4-zh-cn mount-utils shadowsocks-libev uhttpd mtr htop tmux nano luci-i18n-wol-zh-cn ethtool tcpdump wpad-mbedtls -wpad-basic-mbedtls dnsmasq-full -dnsmasq openvpn-mbedtls luci-app-openvpn zerotier
INCLUDE_FILES: true
ROOTFS_PARTSIZE: 0
- PROFILE: friendlyarm_nanopi-r2s
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/rockchip/armv8/openwrt-imagebuilder-23.05.0-rc2-rockchip-armv8.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates block-mount usbutils curl iperf3 iperf3 mtr htop tmux nano lsblk ethtool tcpdump ip-full kmod-ipt-tproxy kmod-nft-tproxy kmod-usb-storage-extras kmod-fs-exfat kmod-fs-vfat kmod-fs-ntfs kmod-fs-ext4 kmod-ipt-nat6 kmod-tun dosfstools ntfs-3g e2fsprogs fdisk exfat-fsck exfat-mkfs libmbedtls luci luci-compat luci-app-openclash kmod-inet-diag libcap-bin luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-ksmbd-zh-cn ksmbd-avahi-service wsdd2 luci-i18n-nlbwmon-zh-cn luci-i18n-aria2-zh-cn ariang luci-i18n-transmission-zh-cn mount-utils uhttpd luci-i18n-wol-zh-cn dnsmasq-full -dnsmasq zerotier luci-i18n-statistics-zh-cn luci-i18n-ttyd-zh-cn collectd-mod-uptime collectd-mod-conntrack collectd-mod-dhcpleases collectd-mod-disk collectd-mod-interface collectd-mod-load collectd-mod-processes collectd-mod-thermal collectd-mod-dns collectd-mod-memory luci-i18n-dockerman-zh-cn dockerd luci-app-vlmcsd netdata
INCLUDE_FILES: true
ROOTFS_PARTSIZE: 4000
- PROFILE: netgear_r7800
IB_URL: https://downloads.openwrt.org/releases/23.05.0-rc2/targets/ipq806x/generic/openwrt-imagebuilder-23.05.0-rc2-ipq806x-generic.Linux-x86_64.tar.xz
PACKAGES: ca-bundle ca-certificates block-mount usbutils coreutils coreutils-base64 curl iperf3 ip-full kmod-ipt-tproxy kmod-nft-tproxy kmod-usb-storage-extras kmod-usb-storage-uas kmod-fs-exfat kmod-fs-vfat kmod-fs-ntfs kmod-fs-ext4 kmod-ipt-nat6 kmod-tun dosfstools ntfs-3g e2fsprogs fdisk libmbedtls luci luci-app-wireguard luci-app-samba4 luci-app-shadowsocks luci-app-smartdns luci-app-dns-forwarder luci-app-openclash kmod-inet-diag stubby luci-i18n-base-zh-cn luci-i18n-firewall-zh-cn luci-i18n-opkg-zh-cn luci-i18n-samba4-zh-cn luci-i18n-smartdns-zh-cn mount-utils shadowsocks-libev smartdns uhttpd iperf3 mtr htop tmux nano lsblk luci-i18n-wol-zh-cn ethtool tcpdump wpad-mbedtls -wpad-basic-mbedtls dnsmasq-full -dnsmasq
INCLUDE_FILES: true
ROOTFS_PARTSIZE: 0
steps:
- uses: actions/checkout@main
- name: Env for Openwrt ImageBuilder
run: sudo apt install -y libncurses-dev
- name: Download Openwrt ImageBuilder
env:
IB_URL: ${{ matrix.IB_URL }}
run: |
wget $IB_URL
tar xf $(basename $IB_URL)
- name: Fetch Files
env:
IB_URL: ${{ matrix.IB_URL }}
if: matrix.INCLUDE_FILES
run: |
IB_HOME=$(basename $IB_URL|head -c -8)
TAG=$(sed -n 's/.*targets\/\(\w*\)\/\(\w*\)\/.*/packages\/\1\/\2/p' <<< $IB_URL)
cd $IB_HOME
mkdir -p files/root/
mkdir -p files/etc/opkg/
cp ../simonsmh-dist.pub files/root/
echo "src/gz simonsmh https://cdn.jsdelivr.net/gh/simonsmh/openwrt-dist@$TAG" > files/etc/opkg/customfeeds.conf
- name: Build Image
shell: bash
env:
PROFILE: ${{ matrix.PROFILE }}
IB_URL: ${{ matrix.IB_URL }}
PACKAGES: ${{ matrix.PACKAGES }}
ROOTFS_PARTSIZE: ${{ matrix.ROOTFS_PARTSIZE }}
run: |
IB_HOME=$(basename $IB_URL|head -c -8)
TAG=$(sed -n 's/.*targets\/\(\w*\)\/\(\w*\)\/.*/packages\/\1\/\2/p' <<< $IB_URL)
cd $IB_HOME
sed -i "/check_signature/d" repositories.conf
echo "src/gz simonsmh https://github.com/simonsmh/openwrt-dist/raw/$TAG" >> repositories.conf
makeopts=("PROFILE=${PROFILE%.*}" "PACKAGES=$PACKAGES")
[[ -d files ]] && makeopts+=("FILES=files/")
[[ $ROOTFS_PARTSIZE -gt 0 ]] && makeopts+=("ROOTFS_PARTSIZE=$ROOTFS_PARTSIZE")
make info
TERM=xterm-256color make image "${makeopts[@]}"
- name: Upload
id: upload
env:
PROFILE: ${{ matrix.PROFILE }}
IB_URL: ${{ matrix.IB_URL }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
IB_HOME=$(basename $IB_URL|head -c -8)
TAG=$(sed -n 's/.*targets\/\(\w*\)\/\(\w*\)\/.*/packages\/\1\/\2/p' <<< $IB_URL)
# Prepare Release
ARTIFACTPATH="$(pwd)/image"
mkdir -p $ARTIFACTPATH
# Upload image
cd $IB_HOME/bin/targets/$(cut -b 10- <<< $TAG)
cp * $ARTIFACTPATH
git init
git config user.name "bot"
git config user.email "bot@github.com"
git add .
git commit -m "$PROFILE$(TZ='Asia/Shanghai' date +@%Y%m%d)"
git push --force --quiet "https://$GITHUB_TOKEN@github.com/simonsmh/openwrt-dist.git" HEAD:image/$PROFILE
- uses: actions/upload-artifact@main
with:
name: image_${{ matrix.PROFILE }}
path: ./image