Update luci-app-turboacc dependencies #587
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update luci-app-turboacc dependencies | |
on: | |
schedule: | |
- cron: '0 23 * * *' | |
workflow_dispatch: | |
inputs: | |
test: | |
description: 'test' | |
required: false | |
type: boolean | |
permissions: | |
contents: write | |
discussions: write | |
jobs: | |
check: | |
outputs: | |
test: ${{ steps.diff.outputs.test }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: 设置时区建立工作文件夹 | |
run: | | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
mkdir -p compare compare/original compare/new clone clone/fullcone-nat-nftables/nft-fullcone clone/coolsnowwolf/lede output/test output/push | |
export COMPARE_PATH="$(pwd)/compare" | |
export CLONE_PATH="$(pwd)/clone" | |
export OUTPUT_PATH="$(pwd)/output" | |
echo "COMPARE_PATH=$COMPARE_PATH" >> $GITHUB_ENV | |
echo "CLONE_PATH=$CLONE_PATH" >> $GITHUB_ENV | |
echo "OUTPUT_PATH=$OUTPUT_PATH" >> $GITHUB_ENV | |
mkdir -p $COMPARE_PATH/new/nft-fullcone $COMPARE_PATH/new/firewall4/patches/ $COMPARE_PATH/new/nftables/patches/ $COMPARE_PATH/new/libnftnl/patches/ | |
mkdir -p $COMPARE_PATH/new/hack-5.10 $COMPARE_PATH/new/hack-5.15 $COMPARE_PATH/new/hack-6.1 $COMPARE_PATH/new/hack-6.6 $COMPARE_PATH/new/pending-5.10 $COMPARE_PATH/new/pending-5.15 $COMPARE_PATH/new/pending-6.1 $COMPARE_PATH/new/pending-6.6 | |
mkdir -p $COMPARE_PATH/original/nft-fullcone | |
mkdir -p $COMPARE_PATH/original/hack-5.10 $COMPARE_PATH/original/hack-5.15 $COMPARE_PATH/original/hack-6.1 $COMPARE_PATH/original/hack-6.6 $COMPARE_PATH/original/pending-5.10 $COMPARE_PATH/original/pending-5.15 $COMPARE_PATH/original/pending-6.1 $COMPARE_PATH/original/pending-6.6 | |
- name: 克隆 | |
run: | | |
git clone --depth=1 --single-branch https://github.com/fullcone-nat-nftables/nft-fullcone $CLONE_PATH/fullcone-nat-nftables/nft-fullcone | |
git clone --depth=1 --single-branch https://github.com/coolsnowwolf/lede $CLONE_PATH/coolsnowwolf/lede | |
git clone --depth=1 --single-branch --branch "package" https://github.com/chenmozhijin/turboacc $CLONE_PATH/chenmozhijin/turboacc | |
git clone --depth=1 --single-branch --branch "master" https://github.com/openwrt/openwrt/ $CLONE_PATH/openwrt/openwrt/ | |
- name: 整理 | |
run: | | |
#nft-fullcone | |
rm -rf $CLONE_PATH/fullcone-nat-nftables/nft-fullcone/.git | |
cp -RT $CLONE_PATH/fullcone-nat-nftables/nft-fullcone $COMPARE_PATH/new/nft-fullcone | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/nft-fullcone $COMPARE_PATH/original/nft-fullcone | |
#hack | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
#cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch | |
# coolsnowwolf/lede#11211 | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
#cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch | |
# coolsnowwolf/lede#11211 | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
#cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/new/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch | |
# coolsnowwolf/lede#11211 | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/new/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-5.10/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-5.10/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-5.15/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-5.15/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-6.1/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-6.1/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/coolsnowwolf/lede/target/linux/generic/pending-6.6/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/new/pending-6.6/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-5.10/952-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-5.10/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-5.15/952-add-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-5.15/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-6.1/952-add-net-conntrack-events-support-multiple-registrant.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-6.1/953-net-patch-linux-kernel-to-support-shortcut-fe.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch $COMPARE_PATH/original/hack-6.6/952-add-net-conntrack-events-support-multiple-registrant.patch || true | |
cp $CLONE_PATH/chenmozhijin/turboacc/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch $COMPARE_PATH/original/hack-6.6/953-net-patch-linux-kernel-to-support-shortcut-fe.patch || true | |
#pending | |
cp $CLONE_PATH/chenmozhijin/turboacc/pending-5.10/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-5.10/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/pending-5.15/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-5.15/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/pending-6.1/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-6.1/613-netfilter_optional_tcp_window_check.patch | |
cp $CLONE_PATH/chenmozhijin/turboacc/pending-6.6/613-netfilter_optional_tcp_window_check.patch $COMPARE_PATH/original/pending-6.6/613-netfilter_optional_tcp_window_check.patch || true | |
#shortcut-fe | |
#cp -RT $CLONE_PATH/coolsnowwolf/lede/package/qca/shortcut-fe $COMPARE_PATH/new/shortcut-fe | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/shortcut-fe $COMPARE_PATH/new/shortcut-fe | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/shortcut-fe $COMPARE_PATH/original/shortcut-fe | |
sed -i "s#DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x +kmod-shortcut-fe#DEPENDS:=@TARGET_ipq806x||TARGET_ipq807x||TARGET_qualcommax +kmod-shortcut-fe#g" $COMPARE_PATH/new/shortcut-fe/simulated-driver/Makefile | |
#firewall4 nftables libnftnl | |
cp -RT $CLONE_PATH/openwrt/openwrt/package/network/config/firewall4/ $COMPARE_PATH/new/firewall4/ | |
cp -RT $CLONE_PATH/openwrt/openwrt/package/network/utils/nftables/ $COMPARE_PATH/new/nftables/ | |
cp -RT $CLONE_PATH/openwrt/openwrt/package/libs/libnftnl/ $COMPARE_PATH/new/libnftnl/ | |
FIREWALL4_VERSION=$(grep -o 'FIREWALL4_VERSION=.*' "$CLONE_PATH/chenmozhijin/turboacc/version" | cut -d '=' -f 2) | |
LIBNFTNL_VERSION=$(grep -o 'LIBNFTNL_VERSION=.*' "$CLONE_PATH/chenmozhijin/turboacc/version" | cut -d '=' -f 2) | |
NFTABLES_VERSION=$(grep -o 'NFTABLES_VERSION=.*' "$CLONE_PATH/chenmozhijin/turboacc/version" | cut -d '=' -f 2) | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/firewall4-$FIREWALL4_VERSION/firewall4/patches/ $COMPARE_PATH/new/firewall4/patches/ | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/nftables-$NFTABLES_VERSION/nftables/patches/ $COMPARE_PATH/new/nftables/patches/ | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/libnftnl-$LIBNFTNL_VERSION/libnftnl/patches/ $COMPARE_PATH/new/libnftnl/patches/ | |
FIREWALL4_NEW_VERSION=$(grep -o 'PKG_SOURCE_VERSION:=.*' $COMPARE_PATH/new/firewall4/Makefile | cut -d '=' -f 2) | |
NFTABLES_NEW_VERSION=$(grep -o 'PKG_VERSION:=.*' $COMPARE_PATH/new/nftables/Makefile | cut -d '=' -f 2) | |
LIBNFTNL_NEW_VERSION=$(grep -o 'PKG_VERSION:=.*' $COMPARE_PATH/new/libnftnl/Makefile | cut -d '=' -f 2) | |
echo "FIREWALL4_NEW_VERSION=$FIREWALL4_NEW_VERSION" >> $GITHUB_ENV | |
echo "NFTABLES_NEW_VERSION=$NFTABLES_NEW_VERSION" >> $GITHUB_ENV | |
echo "LIBNFTNL_NEW_VERSION=$LIBNFTNL_NEW_VERSION" >> $GITHUB_ENV | |
echo "FIREWALL4_NEW_VERSION=$FIREWALL4_NEW_VERSION" | |
echo "NFTABLES_NEW_VERSION=$NFTABLES_NEW_VERSION" | |
echo "LIBNFTNL_NEW_VERSION=$LIBNFTNL_NEW_VERSION" | |
echo "FIREWALL4_VERSION=$FIREWALL4_NEW_VERSION" > $OUTPUT_PATH/push/version | |
echo "NFTABLES_VERSION=$NFTABLES_NEW_VERSION" >> $OUTPUT_PATH/push/version | |
echo "LIBNFTNL_VERSION=$LIBNFTNL_NEW_VERSION" >> $OUTPUT_PATH/push/version | |
echo "FIREWALL4_VERSION=$FIREWALL4_NEW_VERSION" > $OUTPUT_PATH/test/version | |
echo "NFTABLES_VERSION=$NFTABLES_NEW_VERSION" >> $OUTPUT_PATH/test/version | |
echo "LIBNFTNL_VERSION=$LIBNFTNL_NEW_VERSION" >> $OUTPUT_PATH/test/version | |
mkdir -p $COMPARE_PATH/new/firewall4-$FIREWALL4_NEW_VERSION/firewall4 $COMPARE_PATH/new/nftables-$NFTABLES_NEW_VERSION/nftables $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl | |
cp -RT $COMPARE_PATH/new/firewall4/ $COMPARE_PATH/new/firewall4-$FIREWALL4_NEW_VERSION/firewall4 | |
cp -RT $COMPARE_PATH/new/nftables/ $COMPARE_PATH/new/nftables-$NFTABLES_NEW_VERSION/nftables | |
cp -RT $COMPARE_PATH/new/libnftnl/ $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl | |
rm -rf $COMPARE_PATH/new/firewall4/ $COMPARE_PATH/new/nftables/ $COMPARE_PATH/new/libnftnl/ | |
if [ -d "$CLONE_PATH/chenmozhijin/turboacc/firewall4-$FIREWALL4_NEW_VERSION" ]; then | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/firewall4-$FIREWALL4_NEW_VERSION $COMPARE_PATH/original/firewall4-$FIREWALL4_NEW_VERSION | |
cp -r $CLONE_PATH/chenmozhijin/turboacc/firewall4-* $OUTPUT_PATH/push/ | |
rm -rf $OUTPUT_PATH/push/firewall4-$FIREWALL4_NEW_VERSION | |
else | |
echo "firewall4有新版本$FIREWALL4_NEW_VERSION" | |
mkdir -p $COMPARE_PATH/original/firewall4-$FIREWALL4_NEW_VERSION | |
cp -r $CLONE_PATH/chenmozhijin/turboacc/firewall4-* $OUTPUT_PATH/push/ | |
fi | |
if [ -d "$CLONE_PATH/chenmozhijin/turboacc/nftables-$NFTABLES_NEW_VERSION" ]; then | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/nftables-$NFTABLES_NEW_VERSION $COMPARE_PATH/original/nftables-$NFTABLES_NEW_VERSION | |
cp -r $CLONE_PATH/chenmozhijin/turboacc/nftables-* $OUTPUT_PATH/push/ | |
rm -rf $OUTPUT_PATH/push/nftables-$NFTABLES_NEW_VERSION | |
else | |
echo "nftables有新版本$NFTABLES_NEW_VERSION" | |
mkdir -p $COMPARE_PATH/original/nftables-$NFTABLES_NEW_VERSION | |
cp -r $CLONE_PATH/chenmozhijin/turboacc/nftables-* $OUTPUT_PATH/push/ | |
fi | |
#修复WARNING: 'automake-1.16' is probably too old. | |
if [ "$(grep -c "# Network$" $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl/Makefile)" -eq '0' ];then | |
echo "添加PKG_FIXUP:=autoreconf" | |
sed -i '/PKG_LICENSE_FILES:=COPYING/a\PKG_FIXUP:=autoreconf' $COMPARE_PATH/new/libnftnl-$LIBNFTNL_NEW_VERSION/libnftnl/Makefile | |
fi | |
if [ -d "$CLONE_PATH/chenmozhijin/turboacc/libnftnl-$LIBNFTNL_NEW_VERSION" ]; then | |
cp -RT $CLONE_PATH/chenmozhijin/turboacc/libnftnl-$LIBNFTNL_NEW_VERSION $COMPARE_PATH/original/libnftnl-$LIBNFTNL_NEW_VERSION | |
cp -r $CLONE_PATH/chenmozhijin/turboacc/libnftnl-* $OUTPUT_PATH/push/ | |
rm -rf $OUTPUT_PATH/push/libnftnl-$LIBNFTNL_NEW_VERSION | |
else | |
echo "libnftnl有新版本$LIBNFTNL_NEW_VERSION" | |
mkdir -p $COMPARE_PATH/original/libnftnl-$LIBNFTNL_NEW_VERSION | |
cp -r $CLONE_PATH/chenmozhijin/turboacc/libnftnl-* $OUTPUT_PATH/push/ | |
fi | |
cp -RT $COMPARE_PATH/new/ $OUTPUT_PATH/test/ | |
cp $CLONE_PATH/chenmozhijin/turboacc/README.md $OUTPUT_PATH/push/README.md | |
cp -RT $COMPARE_PATH/new/ $OUTPUT_PATH/push/ | |
ls -la $(find $GITHUB_WORKSPACE -type d) | |
- name: 对比 | |
id: diff | |
run: | | |
if diff -r "$COMPARE_PATH/original/" "$COMPARE_PATH/new/"; then | |
echo "The contents of $COMPARE_PATH/original/ and $COMPARE_PATH/new/ are the same." | |
echo "test=false" >> "$GITHUB_OUTPUT" | |
else | |
echo "The contents of $COMPARE_PATH/original/ and $COMPARE_PATH/new/ are different." | |
echo "test=true" >> "$GITHUB_OUTPUT" | |
fi | |
- name: 准备上传 | |
run: | | |
cd $OUTPUT_PATH/push/ | |
tar cvpzf $GITHUB_WORKSPACE/new.tgz * | |
- name: 上传 文件 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: new | |
path: new.tgz | |
test: | |
needs: check | |
if: needs.check.outputs.test == 'true' || inputs.test | |
strategy: | |
fail-fast: false | |
max-parallel: 10 | |
matrix: | |
tag_branche: [master,openwrt-24.10,openwrt-23.05,openwrt-22.03] | |
compile: [FLOW_OFFLOAD,SHORTCUT_FE,SHORTCUT_FE_CM,SHORTCUT_FE_DRV] | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 下载new | |
uses: actions/download-artifact@v4 | |
with: | |
name: new | |
- name: 解压 | |
run: | | |
mkdir -p turboacc | |
export TURBOACC_PATH="$(pwd)/turboacc" | |
echo "TURBOACC_PATH=$TURBOACC_PATH" >> $GITHUB_ENV | |
tar xvpfz $GITHUB_WORKSPACE/new.tgz -C $TURBOACC_PATH | |
- name: 检测 | |
run: ls -la $(find $GITHUB_WORKSPACE -type d) | |
- name: 安装编译依赖 | |
run: | | |
sudo -E apt update | |
sudo -E apt-mark hold grub-efi-amd64-signed | |
sudo -E apt -y full-upgrade | |
sudo apt install -y build-essential clang flex bison g++ gawk gcc-multilib g++-multilib \ | |
gettext git libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget | |
sudo -E systemctl daemon-reload | |
sudo -E apt -y autoremove --purge | |
sudo -E apt clean | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
- name: 克隆源代码 | |
run: | | |
git clone https://git.openwrt.org/openwrt/openwrt.git | |
cd openwrt | |
export OPENWRT_ROOT_PATH="$(pwd)" | |
echo "OPENWRT_ROOT_PATH=$OPENWRT_ROOT_PATH" >> $GITHUB_ENV | |
- name: 切换标签/分支 | |
run: | | |
echo "${{ matrix.tag_branche }}" | |
cd $OPENWRT_ROOT_PATH | |
git checkout "${{ matrix.tag_branche }}" | |
- name: 修复问题 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
sed -i 's/^ DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt$/ DEPENDS:= +kmod-crypto-manager +kmod-crypto-pcbc +kmod-crypto-fcrypt +kmod-udptunnel4 +kmod-udptunnel6/' package/kernel/linux/modules/netsupport.mk #https://github.com/openwrt/openwrt/commit/ecc53240945c95bc77663b79ccae6e2bd046c9c8 | |
sed -i 's/^ dnsmasq \\$/ dnsmasq-full \\/g' ./include/target.mk | |
sed -i 's/^ b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)"/ $(TOPDIR)\/tools\/b43-tools\/files\/b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)"/' ./package/kernel/mac80211/broadcom.mk | |
- name: 更新 feeds | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
- name: 生成配置文件 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
if [ "${{ matrix.compile }}" = "SHORTCUT_FE_DRV" ]; then | |
echo "CONFIG_TARGET_ipq807x=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_ipq807x_generic=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_ipq807x_generic_DEVICE_redmi_ax6=y" >> $OPENWRT_ROOT_PATH/.config | |
else | |
echo "CONFIG_TARGET_x86=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_x86_64=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_x86_64_DEVICE_generic=y" >> $OPENWRT_ROOT_PATH/.config | |
fi | |
make defconfig | |
- name: 添加turboacc | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
if [ "${{ matrix.compile }}" = "FLOW_OFFLOAD" ]; then | |
curl -sSL https://raw.githubusercontent.com/chenmozhijin/turboacc/luci/add_turboacc.sh -o add_turboacc.sh && bash add_turboacc.sh --no-sfe --local-pkg $TURBOACC_PATH | |
else | |
curl -sSL https://raw.githubusercontent.com/chenmozhijin/turboacc/luci/add_turboacc.sh -o add_turboacc.sh && bash add_turboacc.sh --local-pkg $TURBOACC_PATH | |
fi | |
kernel_version="$(sed -n '/CONFIG_LINUX_/p' $OPENWRT_ROOT_PATH/.config | sed -e 's/CONFIG_LINUX_//' -e 's/=y//' -e 's/_/./g')" | |
#log | |
echo "libnftnl-file" | |
ls $OPENWRT_ROOT_PATH/package/libs/libnftnl | |
echo "firewall4-file" | |
ls $OPENWRT_ROOT_PATH/package/network/config/firewall4 | |
echo "nftables-file" | |
ls $OPENWRT_ROOT_PATH/package/network/utils/nftables | |
echo "firewall4-patches" | |
ls $OPENWRT_ROOT_PATH/package/network/config/firewall4/patches/ | |
echo "libnftnl-patches" | |
ls $OPENWRT_ROOT_PATH/package/libs/libnftnl/patches/ | |
echo "nftables-patches" | |
ls $OPENWRT_ROOT_PATH/package/network/utils/nftables/patches/ | |
echo "hack-$kernel_version" | |
ls $OPENWRT_ROOT_PATH/target/linux/generic/hack-$kernel_version | |
echo "pending-$kernel_version" | |
ls $OPENWRT_ROOT_PATH/target/linux/generic/pending-$kernel_version | |
- name: 加载配置并生成配置文件 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
echo "compile = "${{ matrix.compile }} | |
rm -rf .config .config.old tmp | |
ls -la | |
if [ "${{ matrix.compile }}" = "SHORTCUT_FE_DRV" ]; then | |
echo "CONFIG_TARGET_ipq807x=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_ipq807x_generic=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_ipq807x_generic_DEVICE_redmi_ax6=y" >> $OPENWRT_ROOT_PATH/.config | |
else | |
echo "CONFIG_TARGET_x86=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_x86_64=y" >> $OPENWRT_ROOT_PATH/.config | |
echo "CONFIG_TARGET_x86_64_DEVICE_generic=y" >> $OPENWRT_ROOT_PATH/.config | |
fi | |
echo 'CONFIG_PACKAGE_luci-app-turboacc=y' >> .config | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_BBR_CCA=y' >> .config | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_NFT_FULLCONE=y' >> .config | |
if [ "${{ matrix.compile }}" = "FLOW_OFFLOAD" ]; then | |
echo "FLOW_OFFLOAD" | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=y' >> .config | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE=n' >> .config | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE_CM=n' >> .config | |
elif [ "${{ matrix.compile }}" = "SHORTCUT_FE" ]; then | |
echo "SHORTCUT_FE" | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=n' >> .config | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE=y' >> .config | |
echo 'CONFIG_PACKAGE_kmod-shortcut-fe-cm=n' >> .config | |
elif [ "${{ matrix.compile }}" = "SHORTCUT_FE_CM" ]; then | |
echo "SHORTCUT_FE_CM" | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=n' >> .config | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE_CM=y' >> .config | |
elif [ "${{ matrix.compile }}" = "SHORTCUT_FE_DRV" ]; then | |
echo "SHORTCUT_FE_DRV" | |
echo 'CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_OFFLOADING=n' >> .config | |
echo "CONFIG_PACKAGE_luci-app-turboacc_INCLUDE_SHORTCUT_FE_DRV=y" >> $OPENWRT_ROOT_PATH/.config | |
else | |
echo "compile = "${{ matrix.compile }} | |
exit 1 | |
fi | |
echo ".config" | |
cat .config | |
make defconfig | |
echo "diffconfig" | |
./scripts/diffconfig.sh | |
- name: 下载 dl 库 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
make download -j16 | |
find dl -size -1024c -exec ls -l {} \; | |
find dl -size -1024c -exec rm -f {} \; | |
make download -j16 || make download -j1 V=s | |
# - name: 下载工具链库 | |
# run: | | |
# cd $OPENWRT_ROOT_PATH | |
# mkdir -p staging_dir | |
# CONFIG_TARGET_BOARD=$(sed -n 's/CONFIG_TARGET_BOARD="\(.*\)"/\1/p' .config) #x86 | |
# CONFIG_TARGET_SUBTARGET=$(sed -n 's/CONFIG_TARGET_SUBTARGET="\(.*\)"/\1/p' .config) #64 | |
# if [ "${{ matrix.tag_branche }}" = "master" ]; then | |
# RELEASE=snapshots | |
# elif [ "${{ matrix.tag_branche }}" = "openwrt-23.05" ] || [ "${{ matrix.tag_branche }}" = "v23.05.0" ]; then | |
# RELEASE=releases/v23.05.0 | |
# elif [ "${{ matrix.tag_branche }}" = "openwrt-22.03" ] || [ "${{ matrix.tag_branche }}" = "v22.03.5" ]; then | |
# RELEASE=releases/22.03.5 | |
# fi | |
# FILE_NAME=$(curl -s -L --retry 3 --connect-timeout 20 https://downloads.openwrt.org/snapshots/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/ | grep -m 1 -o "openwrt-toolchain-${CONFIG_TARGET_BOARD}-${CONFIG_TARGET_SUBTARGET}_gcc[^\"]*\.Linux-${CONFIG_TARGET_BOARD}_${CONFIG_TARGET_SUBTARGET}\.tar\.xz" | sed 's/^.*<a href="//' | sort -u) | |
# curl -L --retry 3 --connect-timeout 20 https://downloads.openwrt.org/$RELEASE/targets/$CONFIG_TARGET_BOARD/$CONFIG_TARGET_SUBTARGET/$FILE_NAME -o staging_dir/toolchain.tar.xz | |
# cd staging_dir | |
# tar xf toolchain.tar.xz | |
# cp -r ./openwrt-toolchain-*/toolchain-* . | |
# rm -rf ./openwrt-toolchain-* | |
- name: 获取信息 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
id: get-info | |
run: | | |
toolchain_commit=$(git log --pretty=tformat:"%h" -n1 tools toolchain) | |
target=$(sed -n '/^CONFIG_TARGET_BOARD/p' ${{ env.OPENWRT_ROOT_PATH }}/.config | sed -e 's/CONFIG_TARGET_BOARD\=\"//' -e 's/\"//') | |
subtarget=$(sed -n '/^CONFIG_TARGET_SUBTARGET/p' ${{ env.OPENWRT_ROOT_PATH }}/.config | sed -e 's/CONFIG_TARGET_SUBTARGET\=\"//' -e 's/\"//') | |
echo "target=$target" >> "$GITHUB_OUTPUT" | |
echo "subtarget=$subtarget" >> "$GITHUB_OUTPUT" | |
echo "toolchain_commit=$toolchain_commit" >> "$GITHUB_OUTPUT" | |
- name: 缓存toolchain | |
uses: actions/cache@v4 | |
id: cache-toolchain | |
with: | |
path: | | |
${{ env.OPENWRT_ROOT_PATH }}/staging_dir/host* | |
${{ env.OPENWRT_ROOT_PATH }}/staging_dir/tool* | |
key: toolchain-${{ steps.get-info.outputs.toolchain_commit }}-${{ steps.get-info.outputs.target }}-${{ steps.get-info.outputs.subtarget }} | |
- name: 构建工具 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }} | |
run: | | |
make tools/install -j $(($(nproc)+1)) || make tools/install -j1 V=s | |
echo "=======================" | |
echo "空间使用情况:" | |
echo "=======================" | |
df --total -Th | |
echo "=======================" | |
- name: 构建工具链 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
if: ${{ steps.cache-toolchain.outputs.cache-hit != 'true' }} | |
run: | | |
make toolchain/install -j $(($(nproc)+1)) || make toolchain/install -j1 V=s | |
echo "=======================" | |
echo "空间使用情况:" | |
echo "=======================" | |
df --total -Th | |
echo "=======================" | |
- name: 构建内核 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
make target/compile -j $(($(nproc)+1)) || make target/compile -j$(nproc) V=s || make target/compile -j1 V=s | |
echo "=======================" | |
echo "空间使用情况:" | |
echo "=======================" | |
df --total -Th | |
echo "=======================" | |
- name: 编译并生成安装包 | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
make package/compile -j $(($(nproc)+1)) || make package/compile -j1 V=s | |
make package/install -j $(($(nproc)+1)) || make package/install -j1 V=s | |
echo "=======================" | |
echo "空间使用情况:" | |
echo "=======================" | |
df --total -Th | |
echo "=======================" | |
du -h --max-depth=1 ./ --exclude=build_dir --exclude=bin | |
du -h --max-depth=1 ./build_dir | |
du -h --max-depth=1 ./bin | |
- name: 准备 artifact | |
working-directory: ${{ env.OPENWRT_ROOT_PATH }} | |
run: | | |
mkdir -p ./artifact | |
ls -la $(find ./bin/packages/ -type d) | |
cp -rf $(find ./bin/packages/ -type f \( -name "*.ipk" -o -name "*.apk" \)) ./artifact | |
cp -rf $(find ./bin/packages/ -type f \( -name "*.ipk" -o -name "*.apk" \)) ./artifact | |
- name: 上传build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: packages-${{ matrix.tag_branche }}-${{ matrix.compile }} | |
path: ${{ env.OPENWRT_ROOT_PATH }}/artifact/** | |
- name: 收集日志 | |
if: success() || failure() | |
run: | | |
mkdir -p logs | |
cd logs | |
export LOG_PATH="$(pwd)" | |
echo "LOG_PATH=$LOG_PATH" >> $GITHUB_ENV | |
cp -r $OPENWRT_ROOT_PATH/logs $LOG_PATH/openwrt-logs || echo "没有openwrt/logs" | |
cp $OPENWRT_ROOT_PATH/.config $LOG_PATH/openwrt.config || echo "没有openwrt/.config" | |
ls -la $(find $OPENWRT_ROOT_PATH/package/ -type d) >> $LOG_PATH/package_files.list | |
ls -la $(find $OPENWRT_ROOT_PATH/linux/generic/ -type d) >> $LOG_PATH/kp_files.list | |
- name: 上传日志 | |
if: success() || failure() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: logs-${{ matrix.tag_branche }}-${{ matrix.compile }} | |
path: "${{ env.LOG_PATH }}" | |
push: | |
needs: [test,check] | |
if: ${{ ! inputs.test }} | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: 将存储库签出到运行器 | |
uses: actions/checkout@v4 | |
with: | |
ref: 'package' | |
path: upload | |
- name: 下载new | |
uses: actions/download-artifact@v4 | |
with: | |
name: new | |
- name: 解压 | |
run: | | |
mkdir -p turboacc | |
export TURBOACC_PATH="$(pwd)/turboacc" | |
echo "TURBOACC_PATH=$TURBOACC_PATH" >> $GITHUB_ENV | |
tar xvpfz $GITHUB_WORKSPACE/new.tgz -C $TURBOACC_PATH | |
- name: 上传 | |
id: upload | |
run: | | |
rm -rf upload/* | |
cp -RT $TURBOACC_PATH upload | |
cd upload | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
git commit -m "update$(TZ='Asia/Shanghai' date +@%Y%m%d)" | |
git push | |
- name: 检测 | |
run: ls -la $(find $GITHUB_WORKSPACE -type d) |