Openwrt 编译 – GitHub Action 自动化编译

然后七年

然后七年

本文将介绍如何进行Openwrt编译,
第一页会介绍手动操作执行编译,
第二页会介绍借助GitHub Action进行编译,
建议在了解手动操作的基础上再尝试GitHub Action托管编译。

手动编译

Openwrt 编译 – 手动编译


GitHub Action 自动化编译

fork 自动化脚本

自动化脚本模板采用 https://github.com/P3TERX/Actions-OpenWrt
进入后使用 Use this template 按钮:
Openwrt 编译 – GitHub Action 自动化编译插图
填写一些基础信息如项目名,此处不详述

从Lean项目生成 .config 编译配置文件

-> 此处可参照本站文章【 Openwrt 编译 – 手动编译

创建 diy-bash-1.sh

diy-bash-1.sh 是一个自动化bash脚本,用于在./scripts/feeds update -a && ./scripts/feeds install -a执行

#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part1.sh
# Description: OpenWrt DIY script part 1 (Before Update feeds)
#

# Uncomment a feed source
# sed -i 's/^#\(.*helloworld\)/\1/' feeds.conf.default
# sed -i -e '/^#/d' feeds.conf.default

# Add a feed source
# sed -i '$a src-git lienol https://github.com/Lienol/openwrt-package' feeds.conf.default
# sed -i 's/#src-git helloworld/src-git helloworld/g' ./feeds.conf.default
# sed -i 's/coolsnowwolf/sirpdboy/g' ./feeds.conf.default
# git clone https://github.com/sirpdboy/sirpdboy-package package/diy
# sed -i '$a src-git luciappwrtbwmon https://github.com/brvphoenix/luci-app-wrtbwmon' feeds.conf.default
# sed -i '$a src-git wrtbwmon https://github.com/brvphoenix/wrtbwmon' feeds.conf.default
# sed -i '$a src-git smartdns https://github.com/pymumu/smartdns' feeds.conf.default
# sed -i '$a src-git luci-app-smartdns https://github.com/pymumu/luci-app-smartdns' feeds.conf.default
# sed -i '$a src-git onliner https://github.com/rufengsuixing/luci-app-onliner' feeds.conf.default
# sed -i '$a src-git luci-app-serverchan https://github.com/tty228/luci-app-serverchan' feeds.conf.default

echo 'src-git helloworld https://github.com/fw876/helloworld' >> feeds.conf.default
# echo 'src-git luciappwrtbwmon https://github.com/brvphoenix/luci-app-wrtbwmon' >> feeds.conf.default
# echo 'src-git wrtbwmon https://github.com/brvphoenix/wrtbwmon' >> feeds.conf.default
# echo 'src-git smartdns https://github.com/pymumu/smartdns' >> feeds.conf.default
# echo 'src-git luciappsmartdns https://github.com/pymumu/luci-app-smartdns' >> feeds.conf.default
# echo 'src-git onliner https://github.com/rufengsuixing/luci-app-onliner' >> feeds.conf.default
# echo 'src-git luciappserverchan https://github.com/tty228/luci-app-serverchan' >> feeds.conf.default

创建 diy-bash-2.sh

diy-bash-2.sh 是一个自动化bash脚本,用于在./scripts/feeds update -a && ./scripts/feeds install -a执行

#!/bin/bash
#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# File name: diy-part2.sh
# Description: OpenWrt DIY script part 2 (After Update feeds)
#

# 切换ramips内核为 5.10
sed -i 's/5.4/5.10/g' ./target/linux/ramips/Makefile

# 切换x86内核为 5.10
# sed -i 's/5.4/5.10/g' ./target/linux/x86/Makefile

# 修复核心及添加温度显示
# sed -i 's|pcdata(boardinfo.system or "?")|luci.sys.exec("uname -m") or "?"|g' feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
# sed -i 's/or "1"%>/or "1"%> ( <%=luci.sys.exec("expr `cat \/sys\/class\/thermal\/thermal_zone0\/temp` \/ 1000") or "?"%> \℃ ) /g' feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm

sed -i 's/invalid/# invalid/g' package/network/services/samba36/files/smb.conf.template

# 注释默认防火墙规则
sed -i "s/echo 'iptables/echo '# iptables/g" ./package/lean/default-settings/files/zzz-default-settings
sed -i "s/echo '\[ -n/echo '# \[ -n/g" ./package/lean/default-settings/files/zzz-default-settings

# 修改版本号-webui
modelmark=R`TZ=UTC-8 date +%Y-%m-%d -d +"0"days`' by xylz0928'
sed -i "s/DISTRIB_REVISION='R[0-9]*\.[0-9]*\.[0-9]*/DISTRIB_REVISION='$modelmark/g" ./package/lean/default-settings/files/zzz-default-settings
# sed -i 's/$(VERSION_DIST_SANITIZED)/$(VERSION_DIST_SANITIZED)-${modelmark}/g' include/image.mk
# sed -i 's/$(VERSION_DIST_SANITIZED)/$(VERSION_DIST_SANITIZED)-$(shell TZ=UTC-8 date +%Y.%m.%d)_By_xylz0928/g' include/image.mk
# echo "DISTRIB_REVISION='${modelmark}'" > ./package/base-files/files/etc/openwrt_release
# sed -i "s/DISTRIB_REVISION='/DISTRIB_REVISION='$(TZ=UTC-8 date +%Y-%m-%d) by xylz0928 /g" ./package/base-files/files/etc/openwrt_release

# 修改tty banner
echo " -----------------------------------------------------" >> /tmp/mark
echo "      █      █  ▚           ▟               █         " >> /tmp/mark
echo "     █████   █      █████████     █        █████████  " >> /tmp/mark
echo "    █ ▃ ██ ██████   ██            █        █   ██     " >> /tmp/mark
echo "  ██ ▃ ██   █ █     █████████     ██████ ██ ████████  " >> /tmp/mark
echo "     ██    █   █    █ ██████  ███▟          █  ██     " >> /tmp/mark
echo "   ██     █     ██  █ █    █      █         █  ██     " >> /tmp/mark
echo "    ▞  ▚   ▚   ▚    █ █    █      █   █  ████████████ " >> /tmp/mark
echo "  ▞▞▞  ▚▚▚ ▚▚▚ ▚▚▚ ▟  ██████      █████        ██     " >> /tmp/mark
echo "                                               ██     " >> /tmp/mark
echo " -----------------------------------------------------" >> /tmp/mark
echo "     _________       _    ___ ___  ___                " >> /tmp/mark
echo "    /        /\     | |  | __|   \| __|               " >> /tmp/mark
echo "   /  LE    /  \    | |__| _|| |) | _|                " >> /tmp/mark
echo "  /    DE  /    \   |____|___|___/|___|               " >> /tmp/mark
echo " /________/  LE  \                                    " >> /tmp/mark
echo " \        \   DE / -----------------------------------" >> /tmp/mark
echo "  \    LE  \    /  %D %V, %C                          " >> /tmp/mark
echo "   \  DE    \  /   timestamp                          " >> /tmp/mark
echo "    \________\/    -----------------------------------" >> /tmp/mark

# sed -i '1,5d' ./package/base-files/files/etc/banner
# sed -i '1r /tmp/mark' ./package/base-files/files/etc/banner

> ./package/base-files/files/etc/banner
cat /tmp/mark >> ./package/base-files/files/etc/banner

# 修改版本号-tty
sed -i "s/timestamp/Built on '$(TZ=UTC-8 date +%Y-%m-%d)' by xylz0928/g" ./package/base-files/files/etc/banner
# echo ' Built on '$(TZ=UTC-8 date +%Y-%m-%d)' by xylz0928' >> ./package/base-files/files/etc/banner
# echo ' -----------------------------------------------------' >> ./package/base-files/files/etc/banner

# Modify index 
#sed -i 's|https://github.com/sirpdboy/openwrt/actions|https://github.com/xylz0928/Openwrt-Make-x86_7621/actions|g' ./package/diy/autocore/files/x86/index.htm
#sed -i 's|https://github.com/sirpdboy/openwrt18.06/issues|https://github.com/xylz0928/Openwrt-Make-x86_7621/issues|g' ./package/diy/autocore/files/x86/index.htm
#sed -i 's|固件TG聊天群|作者网站首页|g' ./package/diy/autocore/files/x86/index.htm
#sed -i 's|https://t.me/joinchat/AAAAAEpRF88NfOK5vBXGBQ|https://7ze.top|g' ./package/diy/autocore/files/x86/index.htm

# Change Argon Theme
# rm -rf ./package/lean/luci-theme-argon 
rm -rf ./feeds/luci/themes/luci-theme-argon
git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git ./package/luci-theme-argon
git clone https://github.com/jerrykuku/luci-app-argon-config.git ./package/luci-app-argon-config

# Change default BackGround img
# rm ./package/luci-theme-argon/htdocs/luci-static/argon/img/bg1.jpg
wget -O ./package/luci-theme-argon/htdocs/luci-static/argon/img/bg1.jpg https://github.com/xylz0928/luci-mod/raw/main/Background/MontereyDark.jpg
svn co https://github.com/xylz0928/luci-mod/trunk/feeds/luci/modules/luci-base/htdocs/luci-static/resources/icons ./package/lucimod
mv package/lucimod/* feeds/luci/modules/luci-base/htdocs/luci-static/resources/icons/

# Change default theme
sed -i 's/bootstrap/argon/g' feeds/luci/collections/luci/Makefile

# Modify default IP
# sed -i 's/192.168.1.1/192.168.100.1/g' package/base-files/files/bin/config_generate
# Modify default Hostname
# sed -i 's/OpenWrt/Openwrtx86/g' package/base-files/files/bin/config_generate

# Remove the default apps
sed -i 's/luci-app-zerotier //g' target/linux/x86/Makefile
sed -i 's/luci-app-unblockmusic //g' target/linux/x86/Makefile
sed -i 's/luci-app-xlnetacc //g' target/linux/x86/Makefile
sed -i 's/luci-app-jd-dailybonus //g' target/linux/x86/Makefile
sed -i 's/luci-app-ipsec-vpnd //g' target/linux/x86/Makefile
sed -i 's/luci-app-adbyby-plus //g' target/linux/x86/Makefile
sed -i 's/luci-app-qbittorrent //g' target/linux/x86/Makefile
sed -i 's/luci-app-dockerman //g' target/linux/x86/Makefile
# sed -i 's/luci-app-sfe //g' target/linux/x86/Makefile
sed -i 's/luci-app-uugamebooster//g' target/linux/x86/Makefile
# sed -i 's/-luci-app-flowoffload//g' target/linux/x86/Makefile
# sed -i 's/kmod-drm-amdgpu \\/kmod-drm-amdgpu/g' target/linux/x86/Makefile
sed -e '/luci-app-filetransfer/d' include/target.mk
sed -e '/luci-app-vlmcsd/d' include/target.mk
sed -e '/luci-app-flowoffload/d' include/target.mk
# Re-enable SFE for 5.10
# sed -i 's/@!LINUX_5_10 //g' package/lean/luci-app-sfe/Makefile

# Add ServerChan
# git clone https://github.com/tty228/luci-app-serverchan.git feeds/luci/applications/luci-app-serverchan
git clone https://github.com/tty228/luci-app-serverchan.git package/luci-app-serverchan

# Add Onliner
# git clone https://github.com/rufengsuixing/luci-app-onliner.git feeds/luci/applications/luci-app-onliner
git clone https://github.com/rufengsuixing/luci-app-onliner.git package/luci-app-onliner

# Add OpenAppFilter
# git clone https://github.com/destan19/OpenAppFilter.git package/OpenAppFilter

# Add Dockerman
git clone https://github.com/lisaac/luci-app-dockerman package/luci-app-dockerman

# remove lede linked luci-app-pushbot
# rm -rf ./package/lean/luci-app-pushbot
rm -rf ./feeds/luci/applications/luci-app-pushbot
# Add PushBot
git clone https://github.com/zzsj0928/luci-app-pushbot package/luci-app-pushbot

# Add Hello World (注意替换名称)
# svn co https://github.com/jerrykuku/luci-app-v55r/trunk/  package/diy/luci-app-v55r
# svn co https://github.com/siropboy/luci-app-v55r-plus/trunk/luci-app-v55r-plus package/new/luci-app-v55r-plus

git clone https://github.com/jerrykuku/lua-maxminddb.git package/lean/lua-maxminddb
#git lua-maxminddb 依赖
git clone https://github.com/jerrykuku/luci-app-v55r.git package/lean/luci-app-v55r

# Add P@55w@II (注意这里要替换名称)
git clone https://github.com/xiaorouji/openwrt-p@55w@II package/openwrt-p@55w@II
# rm -rf ./package/lean/dns2socks
# rm -rf ./package/lean/ipt2socks
# rm -rf ./package/lean/kcptun
# rm -rf ./package/lean/microsocks
# rm -rf ./package/lean/5h@d0vv50ck5r-libev
# rm -rf ./package/lean/simple-obfs
# rm -rf ./package/lean/tcping
# rm -rf ./package/lean/trojan
# rm -rf ./package/lean/v二r@y
# rm -rf ./package/lean/v二r@y-plugin
# rm -rf ./package/openwrt-p@55w@II/naiveproxy
# rm -rf ./package/openwrt-p@55w@II/tcping
# rm -rf ./package/openwrt-p@55w@II/×r@y-core
# rm -rf ./package/openwrt-p@55w@II/v二r@y
# rm -rf ./package/openwrt-p@55w@II/v二r@y-plugin
# rm -rf ./feeds/helloworld/naiveproxy
# rm -rf ./feeds/helloworld/tcping
# rm -rf ./feeds/helloworld/×r@y-core

# Add 0penCl@5h (注意这里要替换名称)
git clone -b master https://github.com/vernesong/0penCl@5h.git package/0penCl@5h

# Add ADGuardHome
# git clone https://github.com/rufengsuixing/luci-app-adguardhome package/luci-app-adguardhome
svn co https://github.com/sirpdboy/sirpdboy-package/trunk/luci-app-adguardhome ./package/luci-app-adguardhome
chmod -R 755 ./package/luci-app-adguardhome/*
svn co https://github.com/sirpdboy/sirpdboy-package/trunk/adguardhome ./package/adguardhome
# sed -i 's/        /    /g' ./package/adguardhome/Makefile
chmod -R 755 ./package/adguardhome/*

# Add WOL Plus
svn co https://github.com/sundaqiang/openwrt-packages/trunk/luci-app-wolplus ./package/luci-app-wolplus
chmod -R 755 ./package/luci-app-wolplus/*

# Add KoolProxyR Plus+
# git clone https://github.com/jefferymvp/luci-app-koolproxyR package/luci-app-koolproxyR
# svn co https://github.com/sirpdboy/sirpdboy-package/trunk/luci-app-koolproxyR ./package/luci-app-koolproxyR
# chmod -R 755 ./package/luci-app-koolproxyR/*

# Add GodProxy
git clone https://github.com/godros/luci-app-godproxy.git package/luci-app-godproxy

# Add luci-app-socat
# svn co https://github.com/Lienol/openwrt-package/trunk/luci-app-socat ./package/luci-app-socat
svn co https://github.com/sirpdboy/sirpdboy-package/trunk/luci-app-socat ./package/luci-app-socat
chmod -R 755 ./package/luci-app-socat/*

# Add luci-app-advanced
svn co https://github.com/sirpdboy/sirpdboy-package/trunk/luci-app-advanced ./package/luci-app-advanced
chmod -R 755 ./package/luci-app-advanced/*

# Add SmartDNS
# rm -rf ./feeds/packages/net/smartdns
# svn co https://github.com/sirpdboy/sirpdboy-package/trunk/luci-app-smartdns ./package/luci-app-smartdns
# svn co https://github.com/sirpdboy/sirpdboy-package/trunk/smartdns ./package/smartdns
# chmod -R 755 ./package/smartdns
# chmod -R 755 ./package/luci-app-smartdns

# Add Poweroff
# git clone https://github.com/xylz0928/luci-app-shutdown package/luci-app-shutdown
git clone https://github.com/esirplayground/luci-app-poweroff package/luci-app-poweroff
# curl -fsSL  https://raw.githubusercontent.com/siropboy/other/master/patch/poweroff/poweroff.htm > ./feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_system/poweroff.htm 
# curl -fsSL  https://raw.githubusercontent.com/siropboy/other/master/patch/poweroff/system.lua > ./feeds/luci/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
# chmod -R 755 ./feeds/luci/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua
# chmod -R 755 ./feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_system/poweroff.htm

# Fix Multi-use on one physical port 
# 修复 5.4.68-5.4.69内核 于 MIPS 架构 单线复用BUG
# 取自 @AmadeusGhost, 原更新内容为 generic: limit commit "ramips/mediatek: improve GRO performance, fix PPE packet parsing" to mediatek target only
# wget https://github.com/AmadeusGhost/lede/commit/7a49d2cf99bd59506bbd9239e0bde81a61f93c40.patch
# git apply 7a49d2cf99bd59506bbd9239e0bde81a61f93c40.patch

添加.config到项目

使用推送或直接在github网页新增文件
此处以x86配置为例

# x86 Make Menu for PVE config 6

CONFIG_TARGET_x86=y
CONFIG_TARGET_x86_64=y
CONFIG_TARGET_x86_64_DEVICE_generic=y
CONFIG_GRUB_IMAGES=y
CONFIG_GRUB_TITLE="xylz0928-OpenWrt"
CONFIG_ISO_IMAGES=y
CONFIG_LIBCURL_MBEDTLS=y
# CONFIG_LIBCURL_OPENSSL is not set
CONFIG_NODEJS_14=y
CONFIG_NODEJS_ICU_NONE=y
CONFIG_PACKAGE_6in4=y
CONFIG_PACKAGE_TURBOACC_INCLUDE_DNSFORWARDER=y
CONFIG_PACKAGE_TURBOACC_INCLUDE_DNSPROXY=y
CONFIG_PACKAGE_UnblockNeteaseMusic=y
CONFIG_PACKAGE_adbyby=y
CONFIG_PACKAGE_bash=y
CONFIG_PACKAGE_blkid=y
CONFIG_PACKAGE_boost=y
CONFIG_PACKAGE_boost-date_time=y
CONFIG_PACKAGE_boost-program_options=y
CONFIG_PACKAGE_boost-system=y
CONFIG_PACKAGE_brook=y
CONFIG_PACKAGE_btrfs-progs=y
CONFIG_PACKAGE_ca-certificates=y
CONFIG_PACKAGE_chinadns-ng=y
CONFIG_PACKAGE_coreutils-nohup=y
CONFIG_PACKAGE_diffutils=y
CONFIG_PACKAGE_dnsforwarder=y
CONFIG_PACKAGE_dnsproxy=y
CONFIG_PACKAGE_frpc=y
CONFIG_PACKAGE_frps=y
CONFIG_PACKAGE_glib2=y
CONFIG_PACKAGE_haproxy=y
CONFIG_PACKAGE_hd-idle=y
CONFIG_PACKAGE_ip6tables=y
CONFIG_PACKAGE_ipt2socks=y
CONFIG_PACKAGE_iptables-mod-conntrack-extra=y
CONFIG_PACKAGE_iptables-mod-extra=y
CONFIG_PACKAGE_iptables-mod-ipopt=y
CONFIG_PACKAGE_iptables-mod-ipsec=y
CONFIG_PACKAGE_iptables-mod-nat-extra=y
CONFIG_PACKAGE_iputils-arping=y
CONFIG_PACKAGE_ipv6helper=y
CONFIG_PACKAGE_kcptun-client=y
CONFIG_PACKAGE_kcptun-config=y
CONFIG_PACKAGE_kmod-crypto-acompress=y
CONFIG_PACKAGE_kmod-crypto-cbc=y
CONFIG_PACKAGE_kmod-crypto-deflate=y
CONFIG_PACKAGE_kmod-crypto-des=y
CONFIG_PACKAGE_kmod-crypto-echainiv=y
CONFIG_PACKAGE_kmod-crypto-kpp=y
CONFIG_PACKAGE_kmod-crypto-lib-blake2s=y
CONFIG_PACKAGE_kmod-crypto-lib-chacha20=y
CONFIG_PACKAGE_kmod-crypto-lib-chacha20poly1305=y
CONFIG_PACKAGE_kmod-crypto-lib-curve25519=y
CONFIG_PACKAGE_kmod-crypto-lib-poly1305=y
CONFIG_PACKAGE_kmod-crypto-md4=y
CONFIG_PACKAGE_kmod-crypto-md5=y
CONFIG_PACKAGE_kmod-crypto-sha512=y
CONFIG_PACKAGE_kmod-fs-btrfs=y
CONFIG_PACKAGE_kmod-fs-cifs=y
CONFIG_PACKAGE_kmod-ifb=y
CONFIG_PACKAGE_kmod-ipsec=y
CONFIG_PACKAGE_kmod-ipsec4=y
CONFIG_PACKAGE_kmod-ipsec6=y
CONFIG_PACKAGE_kmod-ipt-conntrack-extra=y
CONFIG_PACKAGE_kmod-ipt-extra=y
CONFIG_PACKAGE_kmod-ipt-ipopt=y
CONFIG_PACKAGE_kmod-ipt-ipsec=y
CONFIG_PACKAGE_kmod-ipt-nat-extra=y
CONFIG_PACKAGE_kmod-ipt-nat6=y
CONFIG_PACKAGE_kmod-iptunnel=y
CONFIG_PACKAGE_kmod-iptunnel4=y
CONFIG_PACKAGE_kmod-iptunnel6=y
CONFIG_PACKAGE_kmod-irqbypass=y
CONFIG_PACKAGE_kmod-kvm-intel=y
CONFIG_PACKAGE_kmod-kvm-x86=y
CONFIG_PACKAGE_kmod-lib-lzo=y
CONFIG_PACKAGE_kmod-lib-raid6=y
CONFIG_PACKAGE_kmod-lib-xor=y
CONFIG_PACKAGE_kmod-lib-zlib-deflate=y
CONFIG_PACKAGE_kmod-lib-zlib-inflate=y
CONFIG_PACKAGE_kmod-lib-zstd=y
CONFIG_PACKAGE_kmod-nf-nat6=y
CONFIG_PACKAGE_kmod-sched-cake=y
CONFIG_PACKAGE_kmod-sched-core=y
CONFIG_PACKAGE_kmod-sit=y
CONFIG_PACKAGE_kmod-tun=y
CONFIG_PACKAGE_kmod-udptunnel4=y
CONFIG_PACKAGE_kmod-udptunnel6=y
CONFIG_PACKAGE_kmod-usb-printer=y
CONFIG_PACKAGE_kmod-wireguard=y
CONFIG_PACKAGE_libatomic=y
CONFIG_PACKAGE_libattr=y
CONFIG_PACKAGE_libcap=y
CONFIG_PACKAGE_libcap-bin=y
CONFIG_PACKAGE_libcap-bin-capsh-shell="/bin/sh"
CONFIG_PACKAGE_libdb47=y
CONFIG_PACKAGE_libevent2=y
CONFIG_PACKAGE_libffi=y
CONFIG_PACKAGE_libgmp=y
CONFIG_PACKAGE_libhttp-parser=y
CONFIG_PACKAGE_libiconv-full=y
CONFIG_PACKAGE_libltdl=y
CONFIG_PACKAGE_liblua5.3=y
CONFIG_PACKAGE_liblzo=y
CONFIG_PACKAGE_libmaxminddb=y
CONFIG_PACKAGE_libminiupnpc=y
CONFIG_PACKAGE_libmount=y
CONFIG_PACKAGE_libnatpmp=y
CONFIG_PACKAGE_libnghttp2=y
CONFIG_PACKAGE_libnss=y
CONFIG_PACKAGE_libruby=y
CONFIG_PACKAGE_libsqlite3=y
CONFIG_PACKAGE_libstdcpp=y
CONFIG_PACKAGE_libubox-lua=y
CONFIG_PACKAGE_libuv=y
CONFIG_PACKAGE_libwebsockets-full=y
CONFIG_PACKAGE_libxml2=y
CONFIG_PACKAGE_libyaml=y
CONFIG_PACKAGE_lm-sensors-detect=y
CONFIG_PACKAGE_lsblk=y
CONFIG_PACKAGE_lua-maxminddb=y
CONFIG_PACKAGE_lua-openssl=y
CONFIG_PACKAGE_luasocket=y
CONFIG_PACKAGE_luci-app-adbyby-plus=y
CONFIG_PACKAGE_luci-app-adguardhome=y
CONFIG_PACKAGE_luci-app-advanced=y
CONFIG_PACKAGE_luci-app-argon-config=y
CONFIG_PACKAGE_luci-app-cifs-mount=y
CONFIG_PACKAGE_luci-app-diskman=y
CONFIG_PACKAGE_luci-app-frpc=y
CONFIG_PACKAGE_luci-app-frps=y
CONFIG_PACKAGE_luci-app-godproxy=y
CONFIG_PACKAGE_luci-app-hd-idle=y
CONFIG_PACKAGE_luci-app-ipsec-vpnd=y
CONFIG_PACKAGE_luci-app-jd-dailybonus=y
CONFIG_PACKAGE_luci-app-mwan3=y
CONFIG_PACKAGE_luci-app-mwan3helper=y
CONFIG_PACKAGE_luci-app-netdata=y
CONFIG_PACKAGE_luci-app-nps=y
CONFIG_PACKAGE_luci-app-onliner=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-0pencl@5h=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_Brook=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_ChinaDNS_NG=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_Kcptun=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_NaiveProxy=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_Hysteria=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_5h@d0vv50ck5R_Libev_Server=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_5h@d0vv50ck5_Rust_Client=y
# 注意替换名称 CONFIG_PACKAGE_luci-app-p@55w@II_INCLUDE_Trojan_GO=y
CONFIG_PACKAGE_luci-app-poweroff=y
CONFIG_PACKAGE_luci-app-pppoe-relay=y
CONFIG_PACKAGE_luci-app-pushbot=y
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_fuse-utils is not set
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-ng is not set
# CONFIG_PACKAGE_luci-app-rclone_INCLUDE_rclone-webui is not set
CONFIG_PACKAGE_luci-app-socat=y
CONFIG_PACKAGE_luci-app-softethervpn=y
CONFIG_PACKAGE_luci-app-sqm=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_Kcptun=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_NaiveProxy=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_Redsocks2=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_5h@d0vv50ck5_Rust_Client=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_5h@d0vv50ck5R_Rust_Server=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_Trojan=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-55r-plus_INCLUDE_V二r@y_Plugin=y
CONFIG_PACKAGE_luci-app-ttyd=y
CONFIG_PACKAGE_luci-app-usb-printer=y
CONFIG_PACKAGE_luci-app-uugamebooster=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-v55r=y
# 注意替换名称  CONFIG_PACKAGE_luci-app-v55r_INCLUDE_Kcptun=y
CONFIG_PACKAGE_luci-app-watchcat=y
CONFIG_PACKAGE_luci-app-webadmin=y
CONFIG_PACKAGE_luci-app-wireguard=y
CONFIG_PACKAGE_luci-app-wrtbwmon=y
CONFIG_PACKAGE_luci-app-zerotier=y
CONFIG_PACKAGE_luci-app-ikoolproxy=y
CONFIG_PACKAGE_luci-app-aliyundrive-webdav=y
CONFIG_PACKAGE_luci-compat=y
CONFIG_PACKAGE_luci-i18n-adbyby-plus-zh-cn=y
CONFIG_PACKAGE_luci-i18n-adguardhome-zh-cn=y
CONFIG_PACKAGE_luci-i18n-cifs-mount-zh-cn=y
CONFIG_PACKAGE_luci-i18n-frpc-zh-cn=y
CONFIG_PACKAGE_luci-i18n-frps-zh-cn=y
CONFIG_PACKAGE_luci-i18n-hd-idle-zh-cn=y
CONFIG_PACKAGE_luci-i18n-ipsec-vpnd-zh-cn=y
CONFIG_PACKAGE_luci-i18n-mwan3-zh-cn=y
CONFIG_PACKAGE_luci-i18n-mwan3helper-zh-cn=y
CONFIG_PACKAGE_luci-i18n-netdata-zh-cn=y
CONFIG_PACKAGE_luci-i18n-nps-zh-cn=y
# 注意替换名称 CONFIG_PACKAGE_luci-i18n-p@55w@II-zh-cn=y
CONFIG_PACKAGE_luci-i18n-poweroff-zh-cn=y
CONFIG_PACKAGE_luci-i18n-pppoe-relay-zh-cn=y
CONFIG_PACKAGE_luci-i18n-socat-zh-cn=y
CONFIG_PACKAGE_luci-i18n-softethervpn-zh-cn=y
CONFIG_PACKAGE_luci-i18n-sqm-zh-cn=y
CONFIG_PACKAGE_luci-i18n-ttyd-zh-cn=y
CONFIG_PACKAGE_luci-i18n-usb-printer-zh-cn=y
CONFIG_PACKAGE_luci-i18n-uugamebooster-zh-cn=y
CONFIG_PACKAGE_luci-i18n-watchcat-zh-cn=y
CONFIG_PACKAGE_luci-i18n-webadmin-zh-cn=y
CONFIG_PACKAGE_luci-i18n-wireguard-zh-cn=y
CONFIG_PACKAGE_luci-i18n-wrtbwmon-zh-cn=y
CONFIG_PACKAGE_luci-i18n-zerotier-zh-cn=y
CONFIG_PACKAGE_luci-proto-ipv6=y
CONFIG_PACKAGE_luci-proto-wireguard=y
CONFIG_PACKAGE_mwan3=y
CONFIG_PACKAGE_naiveproxy=y
CONFIG_PACKAGE_netdata=y
CONFIG_PACKAGE_node=y
CONFIG_PACKAGE_npc=y
CONFIG_PACKAGE_nspr=y
CONFIG_PACKAGE_odhcp6c=y
CONFIG_PACKAGE_odhcp6c_ext_cer_id=0
CONFIG_PACKAGE_odhcpd-ipv6only=y
CONFIG_PACKAGE_odhcpd_ipv6only_ext_cer_id=0
CONFIG_PACKAGE_openssh-client=y
CONFIG_PACKAGE_openssh-client-utils=y
CONFIG_PACKAGE_openssh-keygen=y
CONFIG_PACKAGE_p910nd=y
CONFIG_PACKAGE_parted=y
CONFIG_PACKAGE_perl=y
CONFIG_PACKAGE_perlbase-base=y
CONFIG_PACKAGE_perlbase-bytes=y
CONFIG_PACKAGE_perlbase-class=y
CONFIG_PACKAGE_perlbase-config=y
CONFIG_PACKAGE_perlbase-cwd=y
CONFIG_PACKAGE_perlbase-errno=y
CONFIG_PACKAGE_perlbase-essential=y
CONFIG_PACKAGE_perlbase-fcntl=y
CONFIG_PACKAGE_perlbase-file=y
CONFIG_PACKAGE_perlbase-filehandle=y
CONFIG_PACKAGE_perlbase-i18n=y
CONFIG_PACKAGE_perlbase-integer=y
CONFIG_PACKAGE_perlbase-io=y
CONFIG_PACKAGE_perlbase-list=y
CONFIG_PACKAGE_perlbase-locale=y
CONFIG_PACKAGE_perlbase-params=y
CONFIG_PACKAGE_perlbase-posix=y
CONFIG_PACKAGE_perlbase-re=y
CONFIG_PACKAGE_perlbase-scalar=y
CONFIG_PACKAGE_perlbase-selectsaver=y
CONFIG_PACKAGE_perlbase-socket=y
CONFIG_PACKAGE_perlbase-symbol=y
CONFIG_PACKAGE_perlbase-tie=y
CONFIG_PACKAGE_perlbase-unicore=y
CONFIG_PACKAGE_perlbase-utf8=y
CONFIG_PACKAGE_perlbase-xsloader=y
CONFIG_PACKAGE_qemu-ga=y
CONFIG_PACKAGE_redsocks2=y
CONFIG_PACKAGE_rp-pppoe-common=y
CONFIG_PACKAGE_rp-pppoe-relay=y
CONFIG_PACKAGE_ruby=y
CONFIG_PACKAGE_ruby-bigdecimal=y
CONFIG_PACKAGE_ruby-date=y
CONFIG_PACKAGE_ruby-dbm=y
CONFIG_PACKAGE_ruby-digest=y
CONFIG_PACKAGE_ruby-enc=y
CONFIG_PACKAGE_ruby-forwardable=y
CONFIG_PACKAGE_ruby-pstore=y
CONFIG_PACKAGE_ruby-psych=y
CONFIG_PACKAGE_ruby-stringio=y
CONFIG_PACKAGE_ruby-strscan=y
CONFIG_PACKAGE_ruby-yaml=y
# 注意替换名称  CONFIG_PACKAGE_5h@d0vv50ck5-rust-sslocal=y
# 注意替换名称  CONFIG_PACKAGE_5h@d0vv50ck5R-rust-ssserver=y
CONFIG_PACKAGE_smartmontools=y
CONFIG_PACKAGE_socat=y
CONFIG_PACKAGE_softethervpn5-bridge=y
CONFIG_PACKAGE_softethervpn5-client=y
CONFIG_PACKAGE_softethervpn5-libs=y
CONFIG_PACKAGE_softethervpn5-server=y
CONFIG_PACKAGE_sqm-scripts=y
CONFIG_PACKAGE_ssocks=y
CONFIG_PACKAGE_strongswan=y
CONFIG_PACKAGE_strongswan-charon=y
CONFIG_PACKAGE_strongswan-ipsec=y
CONFIG_PACKAGE_strongswan-minimal=y
CONFIG_PACKAGE_strongswan-mod-aes=y
CONFIG_PACKAGE_strongswan-mod-gmp=y
CONFIG_PACKAGE_strongswan-mod-hmac=y
CONFIG_PACKAGE_strongswan-mod-kernel-libipsec=y
CONFIG_PACKAGE_strongswan-mod-kernel-netlink=y
CONFIG_PACKAGE_strongswan-mod-nonce=y
CONFIG_PACKAGE_strongswan-mod-pubkey=y
CONFIG_PACKAGE_strongswan-mod-random=y
CONFIG_PACKAGE_strongswan-mod-sha1=y
CONFIG_PACKAGE_strongswan-mod-socket-default=y
CONFIG_PACKAGE_strongswan-mod-stroke=y
CONFIG_PACKAGE_strongswan-mod-updown=y
CONFIG_PACKAGE_strongswan-mod-x509=y
CONFIG_PACKAGE_strongswan-mod-xauth-generic=y
CONFIG_PACKAGE_strongswan-mod-xcbc=y
CONFIG_PACKAGE_tc-mod-iptables=y
CONFIG_PACKAGE_tc-tiny=y
CONFIG_PACKAGE_trojan=y
CONFIG_PACKAGE_trojan-go=y
CONFIG_PACKAGE_trojan-plus=y
CONFIG_PACKAGE_ttyd=y
CONFIG_PACKAGE_uclibcxx=y
CONFIG_PACKAGE_unzip=y
CONFIG_PACKAGE_uugamebooster=y
# 注意替换名称  CONFIG_PACKAGE_v二r@y-plugin=y
CONFIG_PACKAGE_virtio-console-helper=y
CONFIG_PACKAGE_watchcat=y
CONFIG_PACKAGE_wireguard-tools=y
# 注意替换名称  CONFIG_PACKAGE_×r@y-geodata=y
# 注意替换名称  CONFIG_PACKAGE_×r@y-plugin=y
CONFIG_PACKAGE_zerotier=y
CONFIG_PARTED_READLINE=y
CONFIG_PERL_NOCOMMENT=y
CONFIG_PERL_THREADS=y
CONFIG_QCOW2_IMAGES=y
CONFIG_SQLITE3_DYNAMIC_EXTENSIONS=y
CONFIG_SQLITE3_FTS3=y
CONFIG_SQLITE3_FTS4=y
CONFIG_SQLITE3_FTS5=y
CONFIG_SQLITE3_JSON1=y
CONFIG_SQLITE3_RTREE=y
CONFIG_STRONGSWAN_ROUTING_TABLE="220"
CONFIG_STRONGSWAN_ROUTING_TABLE_PRIO="220"
CONFIG_TARGET_IMAGES_GZIP=y
CONFIG_TARGET_KERNEL_PARTSIZE=64
CONFIG_TARGET_ROOTFS_PARTSIZE=512
CONFIG_TROJAN_GO_COMPRESS_UPX=y
CONFIG_UnblockNeteaseMusic_NodeJS=y
CONFIG_VDI_IMAGES=y
CONFIG_VHDX_IMAGES=y
CONFIG_boost-compile-visibility-hidden=y
CONFIG_boost-runtime-shared=y
CONFIG_boost-static-and-shared-libs=y
CONFIG_boost-variant-release=y

创建/编辑GitHub Action脚本文件

在项目下创建 .github/workflows/build-openwrt-x86.yml
详解如下:

#
# Copyright (c) 2019-2020 P3TERX <https://p3terx.com>
#
# This is free software, licensed under the MIT License.
# See /LICENSE for more information.
#
# https://github.com/P3TERX/Actions-OpenWrt
# Description: Build OpenWrt using GitHub Actions
#

# 项目名:你可以更改它
name: Build OpenWrt

on:
  repository_dispatch:
  workflow_dispatch:
    inputs:
      ssh:
        description: 'SSH connection to Actions'
        required: false # 你可以更改它为true,这样你可以在执行编译前ssh进入到项目运行Ubuntu,以便检查与调试,建议正常运作后关闭此开关
        default: 'false'

env:
  REPO_URL: https://github.com/coolsnowwolf/lede # 源码地址,你可以更改为其他你想要的openwrt源码仓库
  REPO_BRANCH: master # 采用的源码分支
  FEEDS_CONF: feeds.conf.default # 默认的feeds文件,你可以直接更改其内容,或通过bash-1脚本来自动化操作
  CONFIG_FILE: .config  #使用的MakeMenuConfig 文件,你可以在同一项目内放置多个.config,然后使用不同的yml运行它
  DIY_P1_SH: diy-part1.sh  #使用的 bash 1 文件,你可以在同一项目内放置多个不同的bash1,然后使用不同的yml运行它
  DIY_P2_SH: diy-part2.sh  #使用的 bash 2 文件,你可以在同一项目内放置多个不同的bash2,然后使用不同的yml运行它
  UPLOAD_BIN_DIR: false  #是否上传编译后的BIN文件夹,默认关
  UPLOAD_FIRMWARE: true  #是否上传编译后的openwrt固件,默认开
  UPLOAD_COWTRANSFER: false  #是否上传编译后的openwrt固件到奶牛快传,默认关
  UPLOAD_WETRANSFER: false #是否上传编译后的openwrt固件到wetransfer,默认关
  UPLOAD_RELEASE: false  #是否上传编译后的openwrt固件到github release,默认关
  TZ: Asia/Shanghai  #运行时区,如果你有执行给固件加时间签的动作建议加上

执行编译

到GitHub Actions界面,选择你刚添加的yml名称,执行编译
Openwrt 编译 – GitHub Action 自动化编译插图1

等待编译成功后(取决于你所编译的复杂度,时长在1-5h),可在Action详情中获取下载链接(如果你有打开)
Openwrt 编译 – GitHub Action 自动化编译插图2

如果想在编译中自动发送通知给你自己,可参考本站文章(纯原创):
链接待添加
如果想在编译过程中直接上传编译后的固件到你的NAS,可参考本站文章(纯原创):
链接待添加

分享到:

发表回复