forked from wukongdaily/AutoBuildImmortalWrt
-
Notifications
You must be signed in to change notification settings - Fork 0
198 lines (183 loc) · 6.95 KB
/
build-dev-board-by-flippy.yml
File metadata and controls
198 lines (183 loc) · 6.95 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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
name: Build Dev Board Firmware(Flippy)
on:
workflow_dispatch:
inputs:
luci_version:
description: "选择luci版本"
required: false
default: "24.10.5"
type: choice
options:
- 24.10.0
- 24.10.1
- 24.10.2
- 24.10.3
- 24.10.4
- 24.10.5
openwrt_kernel:
description: "选择构建的内核 当高版本内核没有时 系统会自动挑选匹配的内核。比如radxa e52c 即便你选择了6.1.y 可能最终构建还是5.10.160"
required: false
default: "6.1.y"
type: choice
options:
- 5.4.y
- 5.10.y
- 5.15.y
- 6.1.y
- 6.6.y
- 6.12.y
openwrt_soc:
description: "选择开发板型号"
required: false
default: "e20c"
type: choice
options:
- e20c
- e24c
- e25
- e52c
- e54c
- rock5b
- rock5c
- r66s
- r68s
- ht2
- h28k
- h66k
- h68k
- h69k
- h69k-max
- h88k
- h88k-v3
- jp-tvbox
- l1pro
- s905
- s905x2
- s905x3
- s912
- s922x
- s922x-n2
include_docker:
description: |
是否编译 Docker 插件
required: true
default: 'no'
type: choice
options:
- 'yes'
- 'no'
skip_imagebuilder:
description: "直接使用底包快速构建固件, 忽略自定义插件 ----(跳过 ImageBuilder)"
required: false
default: false
type: boolean
replace_banner:
description: '替换为ImmortalWrt的banner信息'
required: false
default: false
type: boolean
rootfs_partsize:
description: '软件包大小1G固定'
required: true
default: "1024"
type: choice
options:
- '1024'
builder_name:
description: "设置打包作者的名称"
required: true
default: 'wukongdaily'
jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set executable permissions
run: chmod +x ${{ github.workspace }}/n1/build.sh
- name: Debug workspace contents
run: ls -R
- name: 处理是否替换 banner 信息
if: ${{ github.event.inputs.skip_imagebuilder == 'false' && github.event.inputs.replace_banner == 'true' }}
run: |
# 使用ImageBuilder构建 且用户勾选了替换banner时
cp n1/99-banner.sh files/etc/uci-defaults/
- name: Build Rootfs for Radxa and Other Boards (ImmortalWrt)
if: ${{ github.event.inputs.skip_imagebuilder != 'true' }}
run: |
echo "✅ 使用 ImageBuilder 构建 rootfs"
profiles="generic"
include_docker="${{ github.event.inputs.include_docker }}"
rootfs_partsize="${{ github.event.inputs.rootfs_partsize }}"
luci_version="${{ github.event.inputs.luci_version }}"
IFS=',' read -r -a profile_array <<< "$profiles"
for profile in "${profile_array[@]}"; do
echo "Building for profile: $profile"
docker run --rm -i \
--user root \
-v "${{ github.workspace }}/bin:/home/build/immortalwrt/bin" \
-v "${{ github.workspace }}/files/etc/uci-defaults:/home/build/immortalwrt/files/etc/uci-defaults" \
-v "${{ github.workspace }}/arch/arch.conf:/home/build/immortalwrt/files/etc/opkg/arch.conf" \
-v "${{ github.workspace }}/shell:/home/build/immortalwrt/shell" \
-v "${{ github.workspace }}/n1/banner:/home/build/immortalwrt/files/mnt/banner" \
-v "${{ github.workspace }}/n1/imm.config:/home/build/immortalwrt/.config" \
-v "${{ github.workspace }}/n1/build.sh:/home/build/immortalwrt/build.sh" \
-e PROFILE=$profile \
-e INCLUDE_DOCKER=$include_docker \
-e ROOTFS_PARTSIZE=$rootfs_partsize \
immortalwrt/imagebuilder:armsr-armv8-openwrt-${luci_version} /bin/bash /home/build/immortalwrt/build.sh
done
- name: Download prebuilt rootfs.tar.gz
if: ${{ github.event.inputs.skip_imagebuilder == 'true' }}
run: |
echo "📦 正在下载预构建 rootfs"
echo "PREBUILT_LUCI_VERSION=24.10.2" >> $GITHUB_ENV
mkdir -p bin/targets/armsr/armv8
curl -L -o bin/targets/armsr/armv8/openwrt-armvirt-64-default-rootfs.tar.gz \
https://github.com/wukongdaily/AutoBuildImmortalWrt/releases/download/rootfs/immortalwrt-24.10.2-armsr-armv8-generic-rootfs.tar.gz
- name: 查找rootfs.tar.gz所在路径
id: find_rootfs
run: |
ROOTFS_FILE=$(find bin/targets/armsr/armv8/ -type f -name "*rootfs.tar.gz" | head -n1)
echo "✅ Found: $ROOTFS_FILE"
if [ ! -f "$ROOTFS_FILE" ]; then
echo "❌ 找不到 rootfs.tar.gz 文件"
exit 1
fi
echo "file=$ROOTFS_FILE" >> $GITHUB_OUTPUT
- name: Package armsr-armv8 as ImmortalWrt for Radxa
uses: wukongdaily/flippy-openwrt-actions@kernel-6.1
if: ${{ steps.down.outputs.status }} == 'success' && !cancelled()
env:
OPENWRT_ARMVIRT: ${{ steps.find_rootfs.outputs.file }}
PACKAGE_SOC: ${{ inputs.openwrt_soc }}
KERNEL_VERSION_NAME: ${{ inputs.openwrt_kernel }}
KERNEL_AUTO_LATEST: true
KERNEL_REPO_URL: "ophub/kernel"
WHOAMI: ${{ inputs.builder_name }}
- name: Rename .img.gz file
id: rename
run: |
FILE=$(ls ${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz | head -n1)
echo "Image file is: $FILE"
FILENAME=$(basename "$FILE")
echo "FILENAME=$FILENAME" >> $GITHUB_ENV
KERNEL_VERSION=$(echo "$FILENAME" | grep -oP 'k\d+\.\d+\.\d+')
MODEL=${{ inputs.openwrt_soc }}
if [ -n "$PREBUILT_LUCI_VERSION" ]; then
echo "PREBUILT_LUCI_VERSION is not empty: $PREBUILT_LUCI_VERSION"
mv "$FILE" "${{ env.PACKAGED_OUTPUTPATH }}/immortalwrt-$PREBUILT_LUCI_VERSION-$MODEL-btrfs-$KERNEL_VERSION.img.gz"
else
LUCI_VERSION="${{ github.event.inputs.luci_version }}"
mv "$FILE" "${{ env.PACKAGED_OUTPUTPATH }}/immortalwrt-$LUCI_VERSION-$MODEL-btrfs-$KERNEL_VERSION.img.gz"
fi
- name: Upload firmware to GitHub Releases
uses: softprops/action-gh-release@v2.2.1
with:
tag_name: flippy
name: ImmortalWrt for Radxa Series and Similar Devices
body_path: ${{ github.workspace }}/n1/radxa.md
files: |
${{ env.PACKAGED_OUTPUTPATH }}/*.img.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}