generated from P3TERX/Actions-OpenWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (112 loc) · 4.92 KB
/
openwrt-master.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
132
133
134
135
136
137
name: 编译openwrt-master
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: |
date=$(TZ="UTC-8" date '+%Y-%m-%d_%H-%M')
echo "date: $date"
echo "filename=openwrt-${date}" >> $GITHUB_OUTPUT
git clone --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.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*