-
Notifications
You must be signed in to change notification settings - Fork 25
180 lines (171 loc) · 4.5 KB
/
all.yml
File metadata and controls
180 lines (171 loc) · 4.5 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
on:
# push:
# branches: [master]
workflow_dispatch:
inputs:
os:
description: 'macos version'
required: false
type: choice
default: 'macos-15'
options:
- macos-13
- macos-14
- macos-15
- macos-26
platform:
description: 'choose a platform for compile'
required: false
type: choice
default: 'all'
options:
- apple
- android
- ios
- tvos
- macos
- all
first_library:
description: 'choose the first library for compile'
required: true
type: choice
default: 'xml2'
options:
- xml2
- unibreak
- fribidi
- freetype
- fontconfig
- harfbuzz
- ass
- yuv
- soundtouch
- opus
- openssl3
- dvdread
- dvdnav
- bluray
- dav1d
- uavs3d
- smb2
- webp
- ijkffmpeg
- fftutorial
- ffmpeg4
- ffmpeg5
- ffmpeg6
- ffmpeg7
dryrun:
description: 'just run workflow,but not deploy'
required: false
type: choice
default: 'false'
options:
- true
- false
verbose:
description: 'print detail logs'
required: false
type: choice
default: 'false'
options:
- true
- false
pull_request:
branches: [master]
name: Create all library Release
jobs:
build:
name: compile all libs for ${{ inputs.platform }} then deploy
runs-on: ${{ inputs.os }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r27c
add-to-path: true
local-cache: false
- name: Checkout code
uses: actions/checkout@v4
- name: One Step
run: |
Platform=${{ inputs.platform }}
DryRun=${{ inputs.dryrun }}
Verbose=${{ inputs.verbose }}
compile_lib() {
local lib_name=$1
local platform=$Platform
if [[ "$lib_name" == "fontconfig" ]]; then
if [[ "$platform" == "all" ]]; then
echo "force platform to android for fontconfig"
platform='android'
elif [[ "$platform" != "android" ]]; then
echo "Skip fontconfig for $platform"
return
fi
fi
if [[ "$lib_name" == "webp" ]]; then
if [[ "$platform" == "android" ]]; then
echo "Skip webp for android"
return
elif [[ "$platform" == "all" ]]; then
echo "Skip webp for android"
platform='apple'
fi
fi
echo "------compile $platform $lib_name------------------------------------"
rm -rf build || git reset --hard || git pull origin
.github/workflows/install-dependencies.sh $lib_name $platform # 补全依赖安装步骤
.github/workflows/onestep.sh $lib_name $platform $DryRun $Verbose
}
libs=(
"xml2"
"unibreak"
"fribidi"
"freetype"
"fontconfig"
"harfbuzz"
"ass"
"yuv"
"soundtouch"
"opus"
"openssl3"
"dvdread"
"dvdnav"
"bluray"
"dav1d"
"uavs3d"
"smb2"
"webp"
"ijkffmpeg"
"fftutorial"
"ffmpeg4"
"ffmpeg5"
"ffmpeg6"
"ffmpeg7"
)
first=${{ inputs.first_library }}
echo "------compile from $first------------------------------------"
# 找到first_library在数组中的索引
start_index=-1
for i in "${!libs[@]}"; do
if [[ "${libs[$i]}" == "$first" ]]; then
start_index=$i
break
fi
done
# 如果找到了 first_library,则截取数组
if [[ $start_index -ne -1 ]]; then
# 仅保留从 start_index 开始到最后的部分
libs=("${libs[@]:$start_index}")
else
echo "Warning: first_library $first not found in the library list."
fi
# 循环遍历所有库执行编译
for lib in "${libs[@]}"; do
compile_lib "$lib"
done
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}