编译openwrt23.05 #171
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: 编译openwrt23.05 | |
on: | |
schedule: | |
- cron: 0 0 */7 * * | |
workflow_dispatch: | |
jobs: | |
built: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: 清理空间 | |
run: | | |
id | |
echo 工作目录:$PWD | |
df -hT | |
sudo apt update | |
sudo apt -y upgrade | |
# dpkg-query -W -f='${Installed-Size;8} ${Package}\n' | sort -n | |
# docker rmi `docker images -q` | |
# sudo -E rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d /usr/local/lib/android | |
# sudo -E apt update >/dev/null | |
# sudo -E apt -y purge microsoft-edge* *azure* kubectl podman containernetworking-plugins r-base-core mono-devel* containerd* temurin* gfortran* docker* ghc* zulu* *llvm* firefox google* dotnet* powershell* openjdk* mysql* php* mongodb* dotnet* snap* >/dev/null | |
# sudo -E systemctl daemon-reload | |
# sudo -E apt -y autoremove --purge >/dev/null | |
# sudo -E apt clean >/dev/null | |
# sudo -E timedatectl set-timezone "Asia/Shanghai" | |
# df -hT | |
# dpkg-query -W -f='${Installed-Size;8} ${Package}\n' | sort -n | |
- name: 安装编译依赖 | |
run: | | |
sudo apt install build-essential clang flex bison g++ gawk \ | |
gcc-multilib g++-multilib gettext git libncurses5-dev libssl-dev \ | |
python3-setuptools rsync swig unzip zlib1g-dev file wget | |
sudo apt -y autoremove --purge | |
sudo apt clean | |
# dpkg-query -W -f='${Installed-Size;8} ${Package}\n' | sort -n | |
df -hT | |
- name: 下载仓库文件到工作目录 | |
uses: actions/checkout@v4 | |
- name: 克隆openwrt源码到工作目录 | |
id: filename | |
run: | | |
chmod +x getLatestTag.sh | |
#version=$(./getLatestTag.sh | tail -n1) | |
version="openwrt-23.05" | |
echo "version: $version" | |
date=$(TZ="UTC-8" date '+%Y-%m-%d_%H-%M') | |
echo "date: $date" | |
echo "filename=${version}_${date}" >> $GITHUB_OUTPUT | |
git clone -b "$version" --depth=1 https://github.com/openwrt/openwrt.git | |
- name: 更新feeds | |
run: | | |
cd openwrt | |
#cp ../feeds.conf.default feeds.conf.default | |
#cat feeds.conf.default | |
./scripts/feeds update -a > /dev/null 2>&1 | |
./scripts/feeds install -a > /dev/null 2>&1 | |
./scripts/feeds install -a | |
df -hT | |
- name: 添加自定义软件包 | |
run: | | |
mv addCusPackage-22.sh openwrt/ | |
cd openwrt | |
chmod +x addCusPackage-22.sh | |
./addCusPackage-22.sh | |
- name: 主页CPU信息补丁 | |
run: | | |
mv patch-luci-status.sh openwrt/ | |
mv luci-status-patch.patch openwrt/ | |
cd openwrt | |
chmod +x patch-luci-status.sh | |
./patch-luci-status.sh | |
- name: 添加主页编译时间 | |
run: | | |
mv addcompiletime.sh openwrt/ | |
cd openwrt | |
chmod +x addcompiletime.sh | |
./addcompiletime.sh | |
- name: fullcone补丁 | |
run: | | |
mv fullcone-patch.sh openwrt/ | |
cd openwrt | |
chmod +x fullcone-patch.sh | |
./fullcone-patch.sh | |
- name: chinadefault设置 | |
run: | | |
mv files openwrt/ | |
- name: defconfig生成配置 | |
run: | | |
cd openwrt | |
rm -rf tmp | |
mv -f ../x86.23.05.config ./.config | |
make defconfig | |
- name: 开始编译 | |
run: | | |
#cd openwrt | |
sudo chmod 777 /mnt | |
mv openwrt /mnt | |
cd /mnt/openwrt | |
make -j8 download >/dev/null | |
make -j8 download | |
nproc | |
make -j$(($(nproc) + 1)) | |
#make -j1 V=s | |
df -hT | |
- name: 上传固件 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{steps.filename.outputs.filename}}-squashfs | |
path: | | |
/mnt/openwrt/bin/targets/*/*/*squashfs-combined-efi.img* | |
- name: 上传固件 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{steps.filename.outputs.filename}}-ext4 | |
path: | | |
/mnt/openwrt/bin/targets/*/*/*ext4-combined-efi.img* | |