Repository navigation
179 lines (148 loc) · 8.26 KB
/
Copy pathRaspberryPi4.yml
File metadata and controls
179 lines (148 loc) · 8.26 KB
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: Build OpenWRT for RaspberryPi4
on: push
env:
SSH_ACTIONS: false
TZ: Asia/Shanghai
upxVersion: 3.96
jobs:
build:
runs-on: ubuntu-18.04
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: free disk space
run: |
sudo swapoff -a
sudo rm -f /swapfile
sudo apt clean
docker rmi $(docker image ls -aq)
df -h
#- name: cleanup old action artifacts
# run: .github/workflows/purge_artifacts.sh ${{ secrets.REPO_ACCESS_TOKEN }}
- name: 安装编译环境需要的依赖包.
run: |
sudo apt-get update
sudo apt-get install -y build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs git-core gcc-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler g++-multilib
sudo apt-get -qq autoremove --purge
sudo apt-get -qq clean
sudo apt clean
- name: 克隆源码
run: |
git clone https://git.openwrt.org/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
- name: 添加luci-app-passwal、luci-app-ssr-plu、luci-app-adbyby-plus
run: |
cd openwrt/package
svn co https://github.com/Lienol/openwrt-package/trunk/lienol/luci-app-passwall
svn co https://github.com/Lienol/openwrt-package/trunk/package/tcping
svn co https://github.com/Lienol/openwrt-package/trunk/package/dns2socks
svn co https://github.com/Lienol/openwrt-package/trunk/package/brook
svn co https://github.com/Lienol/openwrt-package/trunk/package/chinadns-ng
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/ipt2socks
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/shadowsocksr-libev
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/v2ray
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/trojan
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/ipt2socks
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/pdnsd-alt
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/v2ray-plugin
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/simple-obfs
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-adbyby-plus
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-ssr-plus
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/srelay
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/adbyby
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/dnsforwarder
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/kcptun
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/UnblockNeteaseMusicGo
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/redsocks2
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/tcpping
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/microsocks
- name: 添加luci-app-vlmcsd、vlmcsd
run: |
cd openwrt/package
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-vlmcsd
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/vlmcsd
- name: 添加其他的软件包源码
run: |
cd openwrt/package
# 网易云音乐解锁
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/UnblockNeteaseMusic
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-unblockmusic
# 百度网盘相关
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/baidupcs-web
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-baidupcs-web
# 动态dns相关
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/ddns-scripts_aliyun
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/ddns-scripts_dnspod
# 内网穿透相关
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/frp
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-frpc
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-nps
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/npc
# Docker相关
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-dockerman
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-lib-docker
# vsftp文件传输
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-vsftpd
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/vsftpd-alt
# 其他软件
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-guest-wifi
svn co https://github.com/coolsnowwolf/lede/trunk/package/lean/luci-app-usb-printer
git clone https://github.com/TheMMcOfficial/lede-cups.git
mkdir yaaw
wget --no-check-certificate -O ./yaaw/Makefile https://raw.githubusercontent.com/openwrt/packages/lede-17.01/net/yaaw/Makefile
# git clone https://github.com/frainzy1477/luci-app-clash.git
# git clone https://github.com/Dreamacro/clash
# luci主题
git clone https://github.com/jerrykuku/luci-theme-argon.git
git clone https://github.com/yangsongli/luci-theme-atmaterial.git
- name: 更新 upx 程序版本,版本太低,压缩的 v2ray 可能会出错
run: |
wget -O /tmp/upx-3.96-amd64_linux.tar.xz https://github.com/upx/upx/releases/download/v3.96/upx-3.96-amd64_linux.tar.xz
cd /tmp && tar xJf upx-3.96-amd64_linux.tar.xz
sudo mv /usr/bin/upx /usr/bin/upx.old && sudo cp /tmp/upx-3.96-amd64_linux/upx /usr/bin/upx
cd - && cp /tmp/upx-3.96-amd64_linux/upx ./openwrt/staging_dir/host/bin/upx
rm -rf /tmp/upx-3.96-amd64_linux*
- name: 整理空间
run: |
sudo mkdir /mnt/openwrt && sudo chown runner.docker /mnt/openwrt
mkdir /mnt/openwrt/dl /mnt/openwrt/bin /mnt/openwrt/build_dir
cd openwrt
mv feeds staging_dir /mnt/openwrt
ln -s /mnt/openwrt/dl ./dl
ln -s /mnt/openwrt/staging_dir ./staging_dir
ln -s /mnt/openwrt/feeds ./feeds
ln -s /mnt/openwrt/bin ./bin
ln -s /mnt/openwrt/build_dir ./build_dir
mkdir -p ./files/etc/hotplug.d/block
mkdir -p ./files/etc/uci-defaults/
wget -O ./files/etc/hotplug.d/block/20-smb https://github.com/Mackerly/OpenWRT-RaspberryPi4/raw/master/20-smb
wget -O ./files/etc/hotplug.d/block/11-mount https://github.com/Mackerly/OpenWRT-RaspberryPi4/raw/master/11-mount
wget -O ./files/etc/banner https://github.com/Mackerly/OpenWRT-RaspberryPi4/raw/master/banner
wget -O ./files/etc/uci-defaults/openwrtinit.sh https://github.com/Mackerly/OpenWRT-RaspberryPi4/raw/master/openwrtinit.sh
chmod +x ./files/etc/uci-defaults/openwrtinit.sh ./files/etc/hotplug.d/block/20-smb ./files/etc/hotplug.d/block/11-mount
- name: 生成默认的.config文件
run: |
# cd openwrt && make defconfig
cd openwrt && rm -f ./.config* && wget --no-check-certificate -O ./.config https://raw.githubusercontent.com/Mackerly/OpenWRT-RaspberryPi4/master/myconfig
make defconfig
- name: SSH 链接到 Actions
uses: Mackerly/debugger-action@master
# uses: csexton/debugger-action@master
if: env.SSH_ACTIONS == 'true'
- name: 下载需要用到的源码包到dl文件夹
run: |
cd openwrt && make download -j8
- name: 开始编译Openwrt
id: compile
run: |
cd openwrt
echo -e "$(nproc) thread compile"
make -j$(nproc) || make -j1 V=s
echo "::set-output name=status::success"
- name: 上传编译的结果到 Actions 页面
uses: actions/upload-artifact@master
if: steps.compile.outputs.status == 'success'
with:
name: OpenWrt
path: openwrt/bin/