Build FFmpeg-Kit LTS for Android #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build FFmpeg-Kit LTS for Android | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| extra_options: | |
| description: '额外构建选项' | |
| required: false | |
| default: '' | |
| type: string | |
| jobs: | |
| build: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: 检出代码 | |
| uses: actions/checkout@v3 | |
| - name: 设置 Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| - name: 安装依赖包 | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y autoconf automake libtool pkg-config curl git doxygen nasm cmake gcc gperf texinfo yasm bison autogen wget autopoint meson ninja-build ragel groff gtk-doc-tools libtasn1-6-dev | |
| - name: 设置 Android SDK | |
| uses: android-actions/setup-android@v2 | |
| - name: 缓存 Android NDK | |
| id: cache-ndk | |
| uses: actions/cache@v3 | |
| with: | |
| path: ${ANDROID_SDK_ROOT}/ndk/android-ndk-r22b | |
| key: android-ndk-r22b | |
| - name: 检查缓存状态 | |
| run: | | |
| if [[ "${{ steps.cache-ndk.outputs.cache-hit }}" == "true" ]]; then | |
| echo "缓存已命中,无需下载 NDK" | |
| else | |
| echo "缓存未命中,将下载 NDK" | |
| fi | |
| - name: 下载 Android NDK | |
| if: steps.cache-ndk.outputs.cache-hit != 'true' | |
| run: | | |
| mkdir -p ${ANDROID_SDK_ROOT}/ndk | |
| wget https://dl.google.com/android/repository/android-ndk-r22b-linux-x86_64.zip | |
| unzip android-ndk-r22b-linux-x86_64.zip -d ${ANDROID_SDK_ROOT}/ndk | |
| - name: 构建 FFmpeg-Kit LTS | |
| run: | | |
| git clone https://github.com/InfinityLoop1308/ffmpeg-kit.git | |
| cd ffmpeg-kit | |
| BUILD_OPTIONS="--lts --enable-gmp --enable-gnutls --enable-android-media-codec --enable-android-zlib" | |
| if [[ -n "${{ github.event.inputs.extra_options }}" ]]; then | |
| BUILD_OPTIONS="${BUILD_OPTIONS} ${{ github.event.inputs.extra_options }}" | |
| fi | |
| ./android.sh ${BUILD_OPTIONS} | |
| - name: 上传 LTS AAR 文件 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ffmpeg-kit-android-lts-aar | |
| path: bundle-android-aar-lts/*.aar | |
| if-no-files-found: warn | |
| - name: 上传预编译库 | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ffmpeg-kit-prebuilt-lts | |
| path: prebuilt/ | |
| if-no-files-found: warn |