-
Notifications
You must be signed in to change notification settings - Fork 8
181 lines (160 loc) · 5.63 KB
/
build-AX6-NSS.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
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
180
181
name: Build OpenWRT for AX6-NSS
on:
workflow_dispatch:
env:
REPO_URL: https://github.com/VIKINGYFY/immortalwrt.git
REPO_BRANCH: main
CONFIG_FILE: AX6-IPQ/.config
DIY_SH: AX6-IPQ/diy.sh
FILES: AX6-IPQ/files
TZ: Asia/Shanghai
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Check machine configuration
run: |
echo "警告⚠"
echo "分配的服务器性能有限,若选择的插件过多,务必注意CPU性能!"
echo "云编译建议取消勾选Node.js及其相关插件!"
echo "已知CPU型号(降序):7763,8370C,8272CL,8171M,E5系列"
echo "--------------------------CPU信息--------------------------"
echo "CPU物理数量:$(cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l)"
echo -e "CPU核心及版本信息:$(cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c) \n"
echo "--------------------------内存信息--------------------------"
echo "已安装内存详细信息:"
sudo lshw -short -C memory | grep GiB
echo -e "\n"
echo "--------------------------硬盘信息--------------------------"
echo -e "硬盘数量:$(ls /dev/sd* | grep -v [1-9] | wc -l) \n"
echo "硬盘详情:"
df -Th
- name: Before freeing up disk space
run: |
echo "Before freeing up disk space"
echo "=============================================================================="
df -hT
echo "=============================================================================="
- name: "Optimize Disk Space"
uses: "hugoalh/[email protected]"
with:
operate_sudo: "True"
general_include: ".+"
general_exclude: |-
^GCC$
^G\+\+$
Clang
LLVM
docker_include: ".+"
docker_prune: "True"
docker_clean: "True"
apt_prune: "True"
apt_clean: "True"
homebrew_prune: "True"
homebrew_clean: "True"
npm_prune: "True"
npm_clean: "True"
os_swap: "True"
- name: Freeing up disk space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 10240
swap-size-mb: 1
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
remove-docker-images: 'true'
- name: Free up disk space complete
run: |
echo "Free up disk space complete"
echo "=============================================================================="
df -hT
echo "=============================================================================="
- name: Checkout
uses: actions/checkout@main
- name: Initialize environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo -E apt-get -qq update -y
sudo -E apt-get -qq install -y $(curl -fsSL https://raw.githubusercontent.com/nantayo/My-Pkg/master/2305)
sudo -E apt-get -qq autoremove --purge
sudo -E apt-get -qq clean
sudo timedatectl set-timezone "$TZ"
sudo chown $USER:$GROUPS $GITHUB_WORKSPACE
- name: Clone source code
working-directory: ./
run: |
git clone $REPO_URL -b $REPO_BRANCH openwrt
- name: cache wrt build
uses: stupidloud/cachewrtbuild@main
with:
ccache: 'true'
mixkey: AX6-NSS-${{ env.REPO_BRANCH }}
prefix: ${{ github.workspace }}/openwrt
- name: Update & Install feeds
working-directory: ./openwrt
run: |
./scripts/feeds update -a
./scripts/feeds install -a
- name: Load custom config
run: |
[ -e $FILES ] && mv $FILES openwrt/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE openwrt/.config
chmod +x $DIY_SH
cd openwrt
$GITHUB_WORKSPACE/$DIY_SH
# - name: SSH connect to Actions
# uses: P3TERX/ssh2actions@main
# if: (github.event.inputs.ssh == 'true') || contains(github.event.action, 'ssh')
- name: Download package
working-directory: ./openwrt
run: |
make defconfig
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Compile the firmware
run: |
chmod -R 755 openwrt
cd openwrt
echo -e "$(nproc) thread compile"
make -j$(nproc) || make -j1 || make -j1 V=s
echo "compile_status=success" >> $GITHUB_ENV
# - name : Upload packages
# uses: actions/upload-artifact@master
# if: always()
# with:
# name: AX6-NSS
# path: openwrt/bin/targets
- name: cp output to upload file
run: |
df -hT
mkdir upload
cp openwrt/bin/targets/*/*/*.ubi upload/
cp openwrt/bin/targets/*/*/*.bin upload/
- name: Get Current Date
run: echo "CURRENT_DATE=$(date '+%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Upload OpenWrt Firmware to Release
uses: ncipollo/release-action@main
with:
tag: AX6_NSS_${{ env.CURRENT_DATE }}
artifacts: upload/*
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
body: |
基于VIKINGYFY合并的immortalwrt构建
首次使用建议全新刷写
NSS满血加速!
* 基本信息
IP: 192.168.1.1
账户: root
密码: 空
- name: Delete old releases
uses: dev-drprasad/delete-older-releases@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
keep_latest: 10
delete_tags : true