This repository has been archived by the owner on Feb 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
127 lines (111 loc) · 4.11 KB
/
ARMv8-Docker-BuildX.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
name: ARMv8 Docker BuildX
on:
workflow_dispatch:
schedule:
- cron: 0 0 * * 6
env:
REPO_URL: https://github.com/coolsnowwolf/lede
REPO_BRANCH: master
CONFIG_FILE: configs/armv8-docker-mini.config
DIY_SCRIPT: diy-mini.sh
CLASH_KERNEL: arm64
DOCKER_BUILD: buildImageX.sh
DOCKER_IMAGE: summary/openwrt-aarch64
TAG: mini
TZ: Asia/Shanghai
jobs:
Build:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@main
- name: Check Server Performance
run: |
echo "警告⚠"
echo "分配的服务器性能有限,若选择的插件过多,务必注意CPU性能!"
echo -e "已知CPU型号(降序): 7763,8370C,8272CL,8171M,E5-2673\n"
echo "--------------------------CPU信息--------------------------"
echo "CPU物理数量: $(cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l)"
echo "CPU核心数量: $(nproc)"
echo -e "CPU型号信息:$(cat /proc/cpuinfo | grep -m1 name | awk -F: '{print $2}')\n"
echo "--------------------------内存信息--------------------------"
echo "已安装内存详细信息:"
echo -e "$(sudo lshw -short -C memory | grep GiB)\n"
echo "--------------------------硬盘信息--------------------------"
echo "硬盘数量: $(ls /dev/sd* | grep -v [1-9] | wc -l)" && df -hT
- name: Initialization Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
docker rmi $(docker images -q)
sudo rm -rf /usr/share/dotnet /etc/apt/sources.list.d /usr/local/lib/android $AGENT_TOOLSDIRECTORY
sudo -E apt-get -y update
sudo -E apt-get -y install $(curl -fsSL is.gd/depends_ubuntu_2204)
sudo -E apt-get -y autoremove --purge
sudo -E apt-get -y clean
sudo timedatectl set-timezone "$TZ"
- name: Clone Source Code
run: |
df -hT $GITHUB_WORKSPACE
git clone $REPO_URL -b $REPO_BRANCH openwrt
cd openwrt
echo "OPENWRT_PATH=$PWD" >> $GITHUB_ENV
- name: Install Feeds
run: |
cd $OPENWRT_PATH
./scripts/feeds update -a
./scripts/feeds install -a
- name: Load Custom Configuration
run: |
[ -e files ] && mv files $OPENWRT_PATH/files
[ -e $CONFIG_FILE ] && mv $CONFIG_FILE $OPENWRT_PATH/.config
sed -i '/\/clash_/d; /.dat/d' scripts/preset-clash-core.sh
chmod +x $GITHUB_WORKSPACE/scripts/*.sh
chmod +x $DIY_SCRIPT
cd $OPENWRT_PATH
$GITHUB_WORKSPACE/$DIY_SCRIPT
$GITHUB_WORKSPACE/scripts/preset-clash-core.sh $CLASH_KERNEL
- name: Download DL Package
run: |
cd $OPENWRT_PATH
make defconfig
make download -j8
find dl -size -1024c -exec ls -l {} \;
find dl -size -1024c -exec rm -f {} \;
- name: Compile Firmware
id: compile
run: |
cd $OPENWRT_PATH
mkdir -p files/etc/uci-defaults
cp $GITHUB_WORKSPACE/scripts/init-settings.sh files/etc/uci-defaults/99-init-settings
echo -e "$(nproc) thread compile"
make -j$(nproc) || make -j1 || make -j1 V=s
echo "status=success" >> $GITHUB_OUTPUT
- name: Generate Firmware
if: steps.compile.outputs.status == 'success'
id: generate
run: |
cd $OPENWRT_PATH/bin/targets/*/*
cat config.buildinfo
cp *rootfs.tar.gz $GITHUB_WORKSPACE/docker
cd $GITHUB_WORKSPACE/docker
chmod +x $DOCKER_BUILD && ./$DOCKER_BUILD
echo "status=success" >> $GITHUB_OUTPUT
- name: Set up QEMU
uses: docker/setup-qemu-action@master
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@master
- name: Login to Docker Hub
uses: docker/login-action@master
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker
if: steps.generate.outputs.status == 'success'
uses: docker/build-push-action@master
with:
context: docker
platforms: linux/arm64
push: true
tags: |
${{ env.DOCKER_IMAGE }}:${{ env.TAG }}