-
Notifications
You must be signed in to change notification settings - Fork 5
131 lines (111 loc) · 4.47 KB
/
rax3000m-builder.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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
- 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 }}