-
Notifications
You must be signed in to change notification settings - Fork 216
/
OpenWrt-Build-Cli-H5.yml
114 lines (98 loc) · 4.72 KB
/
OpenWrt-Build-Cli-H5.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
#
# This is free software, lisence use MIT.
#
# Copyright (C) 2019 Jolly <https://totoro.site>
#
# <https://github.com/skytotwo/NanoPi-R1S-Build-By-Actions>
#
# Write by Jolly 2019/12/7
# last update at 2019/12/19
name: NanoPi-R1s H5 OpenWrt Lean Build
on:
push:
branches:
- master
# schedule:
# - cron: 0 20 * * *
# release:
# types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@master
with:
ref: master
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo rm -rf /etc/apt/sources.list.d
sudo apt-get update
sudo apt-get -y install bc build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch 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
wget -O - https://raw.githubusercontent.com/friendlyarm/build-env-on-ubuntu-bionic/master/install.sh | bash
sudo rm -rf /usr/share/dotnet /usr/local/lib/android/sdk
- name: Install Repo
run: |
git clone https://github.com/friendlyarm/repo
sudo cp repo/repo /usr/bin/
- name: Download Source
run: |
mkdir friendlywrt-h5
cd friendlywrt-h5
repo init -u https://github.com/friendlyarm/friendlywrt_manifests -b master -m h5.xml --repo-url=https://github.com/friendlyarm/repo --no-clone-bundle
repo sync -c --no-clone-bundle -j8
- name: Merge UpStearm OpenWrt
run: |
cd friendlywrt-h5
. ../remove_unused_config.sh
cat ../app_config.seed >> configs/config_h5
echo '# CONFIG_V2RAY_COMPRESS_UPX is not set' >> configs/config_h5
sed -i '/docker/Id;/containerd/Id;/runc/Id;/iptparser/Id' configs/config_h5 #fix compile error
cd friendlywrt
git config --local user.email "action@github.com" && git config --local user.name "GitHub Action"
git remote add upstream https://github.com/coolsnowwolf/lede && git fetch upstream
git rebase 90bb1cf9c33e73de5019686b8bd495f689e675a4^ --onto upstream/master -X theirs
git checkout upstream/master -- feeds.conf.default
cd package/lean/
rm -rf luci-theme-argon
git clone -b 18.06 https://github.com/jerrykuku/luci-theme-argon.git
cd ../../
sed -i '/exit/i\mv /etc/rc.d/S25dockerd /etc/rc.d/S92dockerd && sed -i "s/START=25/START=92/g" S92dockerd' package/lean/default-settings/files/zzz-default-settings
sed -i '/uci commit luci/i\uci set luci.main.mediaurlbase="/luci-static/argon"' package/lean/default-settings/files/zzz-default-settings
sed -i '/exit/i\chown -R root:root /usr/share/netdata/web' package/lean/default-settings/files/zzz-default-settings
sed -i 's/option fullcone\t1/option fullcone\t0/' package/network/config/firewall/files/firewall.config
sed -i '/8.8.8.8/d' package/base-files/files/root/setup.sh
echo -e '\nDYC Build\n' >> package/base-files/files/etc/banner
- name: Mod luci
run: |
cd friendlywrt-h5/friendlywrt
./scripts/feeds update -a && ./scripts/feeds install -a
sed -i '/Load Average/i\<tr><td width="33%"><%:CPU Temperature%></td><td><%=luci.sys.exec("cut -c1-2 /sys/class/thermal/thermal_zone0/temp")%></td></tr>' feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
sed -i 's/pcdata(boardinfo.system or "?")/"ARMv8"/' feeds/luci/modules/luci-mod-admin-full/luasrc/view/admin_status/index.htm
- name: Build OpenWrt
run: |
cd friendlywrt-h5
cp configs/config_h5 friendlywrt/.config
cd friendlywrt
make defconfig && make download -j8
make -s -j$(nproc) || make V=s -j1
- name: Build SD img
run: |
cd friendlywrt-h5
sed -i '130,150 {/build_friendlywrt/d}' scripts/build.sh
./build.sh nanopi_r1s.mk
- name: Zip Files
run: |
find friendlywrt-h5/out/ -name "FriendlyWrt_*img*" | xargs -i zip -r {}.zip {}
- name: Assemble Artifact
run: |
rm -rf ./artifact/
mkdir -p ./artifact/
find friendlywrt-h5/out/ -name "FriendlyWrt_*img.zip*" | xargs -i mv -f {} ./artifact/
- name: Upload Artifact
uses: actions/upload-artifact@master
with:
name: FriendlyWrt_NanoPi-R1S H5 Lean
path: ./artifact/