Build_x86_504_stable #21
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: Build_x86_504_stable | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
# 定时触发编译 | |
schedule: | |
- cron: 22 18 * * 4 | |
# 点赞☆Star触发编译 | |
# watch: | |
# types: [started] | |
jobs: | |
Build_x86_504_stable: | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc /opt/hostedtoolcache/CodeQL | |
sudo docker image prune --all --force | |
sudo -E apt-get -qq update | |
sudo -E apt-get -qq install ack antlr3 asciidoc autoconf automake autopoint binutils bison build-essential bzip2 ccache cmake cpio curl device-tree-compiler fastjar flex gawk gettext gcc-multilib g++-multilib git gperf haveged help2man intltool libc6-dev-i386 libelf-dev libfuse-dev libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libpython3-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp ninja-build p7zip p7zip-full patch pkgconf python3 python3-pyelftools python3-setuptools qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev g++ file clang | |
sudo -E apt-get -qq autoremove --purge | |
sudo -E apt-get -qq clean | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
git config --global user.name 'GitHub Actions' && git config --global user.email 'noreply@github.com' | |
df -h | |
- name: Clone source code | |
env: | |
REPO_URL: https://github.com/coolsnowwolf/lede | |
REPO_BRANCH: master | |
run: | | |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt | |
cd openwrt | |
cp -f ../diy/lean/lean01.sh ./ | |
chmod +x ./lean01.sh && ./lean01.sh | |
- name: Update & Install feeds | |
working-directory: ./openwrt | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
cp -f ../diy/lean/lean02.sh ./ | |
chmod +x ./lean02.sh && ./lean02.sh | |
sed -i "s/KERNEL_PATCHVER:=*.*/KERNEL_PATCHVER:=5.4/g" target/linux/x86/Makefile | |
sed -i "s/KERNEL_TESTING_PATCHVER:=*.*/KERNEL_TESTING_PATCHVER:=5.4/g" target/linux/x86/Makefile | |
sed -i "s/DISTRIB_DESCRIPTION='*.*'/DISTRIB_DESCRIPTION='AE86Wrt-X86-Stable-$(date +%Y%m%d)'/g" package/lean/default-settings/files/zzz-default-settings | |
- name: Configuration Customization - Build_x86_504_stable | |
env: | |
CONFIG_FILE: './configs/X86/x86_504_stable.config' | |
run: | | |
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config | |
cd openwrt && make defconfig | |
- name: Download package | |
working-directory: ./openwrt | |
run: | | |
make download -j$(nproc) | |
find dl -size -1024c -exec ls -l {} \; | |
find dl -size -1024c -exec rm -f {} \; | |
- name: Build firmware | |
working-directory: ./openwrt | |
run: | | |
make -j$(nproc) V=s | |
- name: Assemble Artifact | |
id: assemble_artifact | |
run: | | |
rm -rf ./X86_Out | |
mkdir -p ./X86_Out/ | |
cp -a ./openwrt/.config ./X86_Out/x86_504_stable.config | |
getmd5() | |
{ | |
md5sum=`md5sum $1` | |
md5=`echo ${md5sum% *}` | |
md5=`echo ${md5:0:10}` | |
} | |
rom=openwrt/bin/targets/x86/64/openwrt-x86-64-generic-squashfs-combined-efi.img.gz | |
getmd5 $rom | |
cp -a $rom ./X86_Out/AE86Wrt-X86-Stable-5.4-$(date +%Y%m%d)_${md5}.img.gz | |
- name: Upload Firmwares | |
uses: actions/upload-artifact@main | |
with: | |
name: X86-OpenWrt-5.4-Stable | |
path: X86_Out/*.img.gz | |
- name: Upload config | |
uses: actions/upload-artifact@main | |
with: | |
name: X86-5.4-stable-config | |
path: X86_Out/x86_504_stable.config | |
- name: Upload Packages | |
uses: actions/upload-artifact@main | |
with: | |
name: X86-504-Packages | |
path: openwrt/bin/packages | |
- name: Generate Tag & Release Name | |
id: generate_name | |
run: | | |
time=$(date +%Y%m%d%H%M%S) | |
release_tag="$time" | |
release_name="软路由(X86_64)稳定版-5.4内核-$(date +%Y%m%d)" | |
echo "release_name=$release_name" >> $GITHUB_OUTPUT | |
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT | |
- name: Create Release & Upload | |
uses: ncipollo/release-action@v1.14.0 | |
with: | |
artifacts: X86_Out/*.img.gz | |
name: ${{ steps.generate_name.outputs.release_name }} | |
tag: ${{ steps.generate_name.outputs.release_tag }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |