Skip to content

Commit e557e94

Browse files
committed
choose the first library for compile
1 parent 509d85c commit e557e94

File tree

1 file changed

+75
-59
lines changed

1 file changed

+75
-59
lines changed

.github/workflows/all.yml

Lines changed: 75 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,30 @@ on:
2424
- tvos
2525
- macos
2626
- all
27+
first_library:
28+
description: 'choose the first library for compile'
29+
required: true
30+
type: choice
31+
default: 'unibreak'
32+
options:
33+
- unibreak
34+
- fribidi
35+
- freetype
36+
- fontconfig
37+
- harfbuzz
38+
- ass
39+
- yuv
40+
- soundtouch
41+
- opus
42+
- openssl3
43+
- dvdread
44+
- dvdnav
45+
- bluray
46+
- dav1d
47+
- uavs3d
48+
- smb2
49+
- webp
50+
- ffmpeg7
2751
dryrun:
2852
description: 'just run workflow,but not deploy'
2953
required: false
@@ -54,66 +78,58 @@ jobs:
5478
uses: actions/checkout@v4
5579
- name: One Step
5680
run: |
57-
echo '------compile unibreak------------------------------------'
58-
rm -rf build || git reset --hard || git pull origin
59-
.github/workflows/onestep.sh unibreak ${{ inputs.platform }} ${{ inputs.dryrun }}
60-
echo '------compile fribidi------------------------------------'
61-
rm -rf build || git reset --hard || git pull origin
62-
.github/workflows/onestep.sh fribidi ${{ inputs.platform }} ${{ inputs.dryrun }}
63-
echo '------compile freetype------------------------------------'
64-
rm -rf build || git reset --hard || git pull origin
65-
.github/workflows/onestep.sh freetype ${{ inputs.platform }} ${{ inputs.dryrun }}
66-
if [[ ${{ inputs.platform }} == android ]]; then
67-
echo '------compile android fontconfig------------------------------------'
81+
compile_lib() {
82+
local lib_name=$1
83+
local platform=${{ inputs.platform }}
84+
local dryrun=${{ inputs.dryrun }}
85+
86+
echo "------compile $lib_name------------------------------------"
6887
rm -rf build || git reset --hard || git pull origin
69-
.github/workflows/install-dependencies.sh fontconfig android
70-
.github/workflows/onestep.sh fontconfig android ${{ inputs.dryrun }}
88+
.github/workflows/install-dependencies.sh $lib_name $platform # 补全依赖安装步骤
89+
.github/workflows/onestep.sh $lib_name $platform $dryrun
90+
}
91+
92+
libs=(
93+
"unibreak"
94+
"fribidi"
95+
"freetype"
96+
"fontconfig"
97+
"harfbuzz"
98+
"ass"
99+
"yuv"
100+
"soundtouch"
101+
"opus"
102+
"openssl3"
103+
"dvdread"
104+
"dvdnav"
105+
"bluray"
106+
"dav1d"
107+
"uavs3d"
108+
"smb2"
109+
"webp"
110+
"ffmpeg7"
111+
)
112+
113+
first=${{ inputs.first_library }}
114+
echo "------compile from $first------------------------------------"
115+
# 找到first_library在数组中的索引
116+
start_index=-1
117+
for i in "${!libs[@]}"; do
118+
if [[ "${libs[$i]}" == "$first" ]]; then
119+
start_index=$i
120+
break
121+
fi
122+
done
123+
# 如果找到了first_library,则调整数组顺序
124+
if [[ $start_index -ne -1 ]]; then
125+
libs=("${libs[@]:$start_index}" "${libs[@]:0:$start_index}")
126+
else
127+
echo "Warning: first_library $first not found in the library list."
71128
fi
72-
echo '------compile harfbuzz------------------------------------'
73-
rm -rf build || git reset --hard || git pull origin
74-
.github/workflows/install-dependencies.sh harfbuzz ${{ inputs.platform }}
75-
.github/workflows/onestep.sh harfbuzz ${{ inputs.platform }} ${{ inputs.dryrun }}
76-
echo '------compile ass------------------------------------'
77-
rm -rf build || git reset --hard || git pull origin
78-
.github/workflows/install-dependencies.sh ass ${{ inputs.platform }}
79-
.github/workflows/onestep.sh ass ${{ inputs.platform }} ${{ inputs.dryrun }}
80-
echo '------compile yuv------------------------------------'
81-
rm -rf build || git reset --hard || git pull origin
82-
.github/workflows/onestep.sh yuv ${{ inputs.platform }} ${{ inputs.dryrun }}
83-
echo '------compile soundtouch------------------------------------'
84-
rm -rf build || git reset --hard || git pull origin
85-
.github/workflows/onestep.sh soundtouch ${{ inputs.platform }} ${{ inputs.dryrun }}
86-
echo '------compile opus------------------------------------'
87-
rm -rf build || git reset --hard || git pull origin
88-
.github/workflows/onestep.sh opus ${{ inputs.platform }} ${{ inputs.dryrun }}
89-
echo '------compile openssl3------------------------------------'
90-
rm -rf build || git reset --hard || git pull origin
91-
.github/workflows/onestep.sh openssl3 ${{ inputs.platform }} ${{ inputs.dryrun }}
92-
echo '------compile dvdread------------------------------------'
93-
rm -rf build || git reset --hard || git pull origin
94-
.github/workflows/onestep.sh dvdread ${{ inputs.platform }} ${{ inputs.dryrun }}
95-
echo '------compile dvdnav------------------------------------'
96-
rm -rf build || git reset --hard || git pull origin
97-
.github/workflows/onestep.sh dvdnav ${{ inputs.platform }} ${{ inputs.dryrun }}
98-
echo '------compile bluray------------------------------------'
99-
rm -rf build || git reset --hard || git pull origin
100-
.github/workflows/install-dependencies.sh bluray ${{ inputs.platform }}
101-
.github/workflows/onestep.sh bluray ${{ inputs.platform }} ${{ inputs.dryrun }}
102-
echo '------compile dav1d------------------------------------'
103-
rm -rf build || git reset --hard || git pull origin
104-
.github/workflows/onestep.sh dav1d ${{ inputs.platform }} ${{ inputs.dryrun }}
105-
echo '------compile uavs3d------------------------------------'
106-
rm -rf build || git reset --hard || git pull origin
107-
.github/workflows/onestep.sh uavs3d ${{ inputs.platform }} ${{ inputs.dryrun }}
108-
echo '------compile smb2------------------------------------'
109-
rm -rf build || git reset --hard || git pull origin
110-
.github/workflows/onestep.sh smb2 ${{ inputs.platform }} ${{ inputs.dryrun }}
111-
echo '------compile webp------------------------------------'
112-
rm -rf build || git reset --hard || git pull origin
113-
.github/workflows/onestep.sh webp ${{ inputs.platform }} ${{ inputs.dryrun }}
114-
echo '------compile ffmpeg7------------------------------------'
115-
rm -rf build || git reset --hard || git pull origin
116-
.github/workflows/install-dependencies.sh ffmpeg7 ${{ inputs.platform }}
117-
.github/workflows/onestep.sh ffmpeg7 ${{ inputs.platform }} ${{ inputs.dryrun }}
129+
130+
# 循环遍历所有库执行编译
131+
for lib in "${libs[@]}"; do
132+
compile_lib "$lib"
133+
done
118134
env:
119135
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

0 commit comments

Comments
 (0)