Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit c1cc769

Browse files
authored
Update build armbian all borad.yml
1 parent 7701ec7 commit c1cc769

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

.github/workflows/build armbian all borad.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,25 +120,26 @@ jobs:
120120
# 进入编译目录
121121
cd build/
122122
123-
# 定义编译函数
123+
# 定义支持的板子列表
124+
declare -a SUPPORTED_BOARDS=("fine3399" "fmx1-pro" "r08" "rock960" "sg2710" "tpm312" "tb-ls3399" "xiaobao-nas" "zysj")
125+
126+
# 编译函数
124127
compile_board() {
125128
local BOARD=$1
126129
echo "Compiling for board: $BOARD"
127130
./compile.sh BOARD=$BOARD RELEASE=${{ inputs.RELEASE }} BRANCH=${{ inputs.BRANCH }} \
128131
BUILD_MINIMAL=no BUILD_DESKTOP=${{ inputs.BUILD_DESKTOP }} KERNEL_CONFIGURE=no \
129-
COMPRESS_OUTPUTIMAGE=${{ inputs.COMPRESS_OUTPUTIMAGE }} BOOT_LOGO=${{ inputs.BOOT_LOGO }}
132+
COMPRESS_OUTPUTIMAGE=${{ inputs.COMPRESS_OUTPUTIMAGE }} BOOT_LOGO=${{ inputs.BOOT_LOGO }} \
133+
> "log-${BOARD}.txt" 2>&1
130134
if [ $? -ne 0 ]; then
131135
echo "Compilation failed for board: $BOARD" >&2
132136
return 1
133137
fi
134138
return 0
135139
}
136140
137-
# 定义支持的板子列表
138-
declare -a SUPPORTED_BOARDS=("fine3399" "fmx1-pro" "r08" "rock960" "sg2710" "tpm312" "tb-ls3399" "xiaobao-nas" "zysj")
139-
140-
# 判断是否为 "all" 编译模式
141-
if [ "${{ inputs.BOARD }}" = "all" ]; then
141+
# 多板编译模式
142+
compile_all_boards() {
142143
FAILED_BOARDS=()
143144
for BOARD in "${SUPPORTED_BOARDS[@]}"; do
144145
if ! compile_board "$BOARD"; then
@@ -149,20 +150,30 @@ jobs:
149150
# 输出失败的板子列表
150151
if [ ${#FAILED_BOARDS[@]} -gt 0 ]; then
151152
echo "The following boards failed to compile: ${FAILED_BOARDS[*]}" >&2
152-
exit 1 # 仅在整个编译完成后退出,而不是在单个板子失败时退出
153+
else
154+
echo "All boards compiled successfully."
153155
fi
154-
else
155-
# 单板编译模式
156-
if [[ " ${SUPPORTED_BOARDS[@]} " =~ " ${{ inputs.BOARD }} " ]]; then
157-
compile_board "${{ inputs.BOARD }}"
158-
if [ $? -ne 0 ]; then
159-
echo "Compilation failed for specified board: ${{ inputs.BOARD }}" >&2
156+
}
157+
158+
# 单板编译模式
159+
compile_single_board() {
160+
local BOARD=${{ inputs.BOARD }}
161+
if [[ " ${SUPPORTED_BOARDS[@]} " =~ " $BOARD " ]]; then
162+
if ! compile_board "$BOARD"; then
163+
echo "Compilation failed for specified board: $BOARD" >&2
160164
exit 1
161165
fi
162166
else
163-
echo "Unsupported board: ${{ inputs.BOARD }}" >&2
167+
echo "Unsupported board: $BOARD" >&2
164168
exit 1
165169
fi
170+
}
171+
172+
# 判断编译模式
173+
if [ "${{ inputs.BOARD }}" = "all" ]; then
174+
compile_all_boards
175+
else
176+
compile_single_board
166177
fi
167178
168179
- name: Set current year and month

0 commit comments

Comments
 (0)