Skip to content

Create all library Release #43

Create all library Release

Create all library Release #43

Workflow file for this run

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
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 }}
compile_lib() {
local lib_name=$1
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
}
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
libs=("${libs[@]:$start_index}" "${libs[@]:0:$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 }}