forked from XinSSS/RunOpenWRT
-
Notifications
You must be signed in to change notification settings - Fork 0
135 lines (112 loc) · 4.19 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: OpenWRT
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
watch:
types: [started]
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug
tags:
description: 'Test scenario tags'
required: false
type: boolean
environment:
description: 'Environment to run tests against'
type: environment
required: false
env:
SSH_ACTIONS: true
jobs:
build_openwrt:
name: Build OpenWrt and release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: master
- name: Space cleanup
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi `docker images -q`
sudo rm -rf /usr/share/dotnet /etc/mysql /etc/php /etc/apt/sources.list.d
sudo -E apt-get -y purge azure-cli ghc* zulu* hhvm llvm* firefox google* dotnet* powershell openjdk* mysql* php*
sudo -E apt-get update
sudo -E apt-get -y install build-essential asciidoc binutils bzip2 gawk gettext git libncurses5-dev libz-dev patch python3 unzip zlib1g-dev lib32gcc1 libc6-dev-i386 subversion flex uglifyjs gcc-multilib g++-multilib p7zip p7zip-full msmtp libssl-dev texinfo libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf
sudo -E apt-get -y autoremove --purge
sudo -E apt-get clean
df -h
- name: Git clone lede and plugins
run: |
git clone --depth 1 https://github.com/coolsnowwolf/lede -b master
- name: add smartdns makefile
run: |
mkdir -pv lede/feeds/packages/net/smartdns
cp SmartDNS-Makefile lede/feeds/packages/net/smartdns/Makefile
- name: git clone smartdns luci code and checkout to lede branch
run: |
git clone https://github.com/pymumu/luci-app-smartdns.git
cd luci-app-smartdns && git checkout lede
cd .. && mv luci-app-smartdns lede/package/lean/
- name: undo ustc source to opkg update
run: |
sed -i '/ustc/d' lede/package/lean/default-settings/files/zzz-default-settings
- name: Update feeds
run: |
ls -l
cat feeds.conf.default >> lede/feeds.conf.default
cd lede
sed -i 's/192.168.1.1/192.168.9.201/g' package/base-files/files/bin/config_generate
./scripts/feeds update -a
./scripts/feeds install -a
- name: Generate configuration file
run: |
\cp .config lede/
cd lede
make defconfig
- name: Make download
run: |
cd lede
make download -j8
find dl -size -1024c -exec rm -f {} \;
df -h
- name: Compile firmware
run: |
cd lede
make -j$(nproc) V=s || make -j1 V=s
echo "======================="
echo "Space usage:"
echo "======================="
df -h
echo "======================="
du -h --max-depth=1 ./ --exclude=build_dir --exclude=bin
du -h --max-depth=1 ./build_dir
du -h --max-depth=1 ./bin
- name: Prepare artifact
run: find ./lede/bin/targets/ -type d -name "packages" | xargs rm -rf {}
- name: Upload firmware
uses: actions/upload-artifact@main
with:
name: OpenWrt_Firmware
path: ./lede/bin/targets/
- name: Upload ipk
uses: actions/upload-artifact@main
with:
name: OpenWrt_IPK
path: ./lede/bin/packages/
- name: Upload config
uses: actions/upload-artifact@main
with:
name: Config
path: ./lede/.config