Build_mt7981_rax3000m #23
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_mt7981_rax3000m | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
# 定时触发编译 | |
schedule: | |
- cron: 25 18 * * 6 | |
# 点赞☆Star触发编译 | |
# watch: | |
# types: [started] | |
jobs: | |
Build_mt7981_rax3000m: | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Clone Repository | |
uses: actions/checkout@v4 | |
- name: Initialization environment | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
run: | | |
sudo timedatectl set-timezone "Asia/Shanghai" | |
sudo -E swapoff -a | |
sudo -E rm -f /swapfile | |
sudo -E docker image prune -a -f | |
sudo -E snap set system refresh.retain=2 | |
sudo -E apt-get -y purge dotnet* firefox ghc* google* hhvm llvm* mono* mysql* openjdk* php* zulu* | |
sudo -E apt-get -y autoremove --purge | |
sudo -E rm -rf /usr/share/dotnet /usr/local/lib/android/sdk /etc/mysql /etc/php /usr/local/share/boost | |
[ -n "$AGENT_TOOLSDIRECTORY" ] && sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
sudo -E apt-get update -y | |
sudo -E apt full-upgrade -y | |
sudo -E apt-get install -y ack antlr3 aria2 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 libglib2.0-dev libgmp3-dev libltdl-dev libmpc-dev libmpfr-dev libncurses5-dev libncursesw5-dev libreadline-dev libssl-dev libtool lrzsz mkisofs msmtp nano ninja-build p7zip p7zip-full patch pkgconf python2.7 python3.8 python3-pip libpython3-dev qemu-utils rsync scons squashfs-tools subversion swig texinfo uglifyjs upx-ucl unzip vim wget xmlto xxd zlib1g-dev libfuse-dev libfuse-dev python3-setuptools | |
sudo -E apt-get clean | |
git config --global user.name 'GitHub Actions' && git config --global user.email '[email protected]' | |
df -h | |
- name: Clone source code | |
env: | |
REPO_URL: https://github.com/hanwckf/immortalwrt-mt798x | |
REPO_BRANCH: openwrt-21.02 | |
run: | | |
git clone --depth 1 $REPO_URL -b $REPO_BRANCH openwrt | |
cd openwrt | |
cp -f ../DIY/diy1.sh ./ | |
chmod +x ./diy1.sh && ./diy1.sh | |
- name: Update & Install feeds | |
working-directory: ./openwrt | |
run: | | |
./scripts/feeds update -a | |
./scripts/feeds install -a | |
cp -f ../DIY/diy2.sh ./ | |
chmod +x ./diy2.sh && ./diy2.sh | |
cp -f ../DIY/diy3.sh ./ | |
chmod +x ./diy3.sh && ./diy3.sh | |
- name: Configuration Customization - Build_mt7981_rax3000m | |
env: | |
CONFIG_FILE: './config/rax3000m.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 ./ARM_Out | |
mkdir -p ./ARM_Out/ | |
getmd5() | |
{ | |
md5sum=`md5sum $1` | |
md5=`echo ${md5sum% *}` | |
md5=`echo ${md5:0:10}` | |
} | |
rom=openwrt/bin/targets/mediatek/mt7981/immortalwrt-mediatek-mt7981-cmcc_rax3000m-squashfs-sysupgrade.bin | |
getmd5 $rom | |
cp -a $rom ./ARM_Out/MzWrt-CMCC-RAX3000M-5.4-$(date +%Y%m%d)_${md5}.bin | |
- name: Upload Firmwares | |
uses: actions/upload-artifact@main | |
with: | |
name: CMCC-RAX3000M-OpenWrt | |
path: ARM_Out/*.bin | |
- name: Upload config | |
uses: actions/upload-artifact@main | |
with: | |
name: rax3000m-config | |
path: openwrt/.config | |
- name: Upload Packages | |
uses: actions/upload-artifact@main | |
with: | |
name: CMCC-RAX3000M-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="MzWrt-CMCC-RAX3000M-$(date +%Y%m%d)" | |
echo "release_name=$release_name" >> $GITHUB_OUTPUT | |
echo "release_tag=$release_tag" >> $GITHUB_OUTPUT | |
- name: Create Release & Upload | |
uses: ncipollo/[email protected] | |
with: | |
artifacts: ARM_Out/* | |
name: ${{ steps.generate_name.outputs.release_name }} | |
tag: ${{ steps.generate_name.outputs.release_tag }} | |
token: ${{ secrets.GITHUB_TOKEN }} |