Repository navigation
build a lib #7
Workflow file for this run
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
| # https://github.com/actions/runner-images | |
| 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-15-intel | |
| - macos-26 | |
| platform: | |
| description: 'choose a platform for compile' | |
| required: false | |
| type: choice | |
| default: 'all' | |
| options: | |
| - apple | |
| - android | |
| - ohos | |
| - all | |
| - ios | |
| - tvos | |
| - macos | |
| lib: | |
| description: 'choose a lib for compile' | |
| required: true | |
| type: choice | |
| default: 'ffmpeg7' | |
| options: | |
| - ffmpeg8 | |
| - ffmpeg8-bin | |
| - ffmpeg7 | |
| - ffmpeg6 | |
| - ffmpeg5 | |
| - ffmpeg4 | |
| - ijkffmpeg | |
| - fftutorial | |
| - ass | |
| - bluray | |
| - dav1d | |
| - dvdread | |
| - dvdnav | |
| - harfbuzz | |
| - fontconfig | |
| - freetype | |
| - fribidi | |
| - lcms2 | |
| - placebo | |
| - moltenvk | |
| - openssl3 | |
| - openssl | |
| - opus | |
| - shaderc | |
| - smb2 | |
| - soundtouch | |
| - uavs3d | |
| - x264 | |
| - x265 | |
| - unibreak | |
| - yuv | |
| - xml2 | |
| - webp | |
| - dovi | |
| dryrun: | |
| description: 'just run workflow,but not deploy' | |
| required: false | |
| type: choice | |
| default: 'false' | |
| options: | |
| - true | |
| - false | |
| verbose: | |
| description: 'print detail logs' | |
| required: true | |
| type: choice | |
| default: 'false' | |
| options: | |
| - true | |
| - false | |
| pull_request: | |
| branches: [master] | |
| name: build a lib | |
| jobs: | |
| build: | |
| name: compile ${{ inputs.lib }} for ${{ inputs.platform }} then deploy | |
| runs-on: ${{ inputs.os }} | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| steps: | |
| - uses: nttld/setup-ndk@v1 | |
| id: setup-ndk | |
| if: | | |
| github.event.inputs.platform == 'all' || | |
| github.event.inputs.platform == 'android' | |
| with: | |
| ndk-version: r27c | |
| add-to-path: true | |
| link-to-sdk: true | |
| local-cache: false | |
| - name: Setup HarmonyOS native SDK | |
| if: | | |
| github.event.inputs.platform == 'ohos' || | |
| github.event.inputs.platform == 'all' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| SDK_URL="https://repo.huaweicloud.com/harmonyos/os/5.0.0-Release/ohos-sdk-mac-public.tar.gz" | |
| SDK_WORK="$RUNNER_TEMP/ohos-sdk" | |
| mkdir -p "$SDK_WORK" | |
| echo "Downloading HarmonyOS SDK: $SDK_URL" | |
| curl -fL --retry 5 --retry-delay 5 "$SDK_URL" -o "$SDK_WORK/ohos-sdk.tar.gz" | |
| tar -xzf "$SDK_WORK/ohos-sdk.tar.gz" -C "$SDK_WORK" | |
| NATIVE_ZIP=$(find "$SDK_WORK" -type f -name 'native-darwin-*.zip' | head -n 1) | |
| [ -z "$NATIVE_ZIP" ] && NATIVE_ZIP=$(find "$SDK_WORK" -type f -name 'native-*.zip' | head -n 1) | |
| if [ -z "$NATIVE_ZIP" ]; then | |
| echo "!! native SDK zip not found inside package:" | |
| find "$SDK_WORK" -maxdepth 4 -type f | sort | |
| exit 1 | |
| fi | |
| unzip -q "$NATIVE_ZIP" -d "$SDK_WORK/native-sdk" | |
| OHOS_NATIVE=$(find "$SDK_WORK/native-sdk" -type d -name native | head -n 1) | |
| if [ -z "$OHOS_NATIVE" ]; then | |
| echo "!! native dir not found after extraction:" | |
| find "$SDK_WORK/native-sdk" -maxdepth 2 -type d | sort | |
| exit 1 | |
| fi | |
| echo "OHOS_SDK_NATIVE=$OHOS_NATIVE" >> "$GITHUB_ENV" | |
| echo "HarmonyOS native SDK at: $OHOS_NATIVE" | |
| ls -la "$OHOS_NATIVE/llvm/bin/clang" | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install cargo-c | |
| if: inputs.lib == 'dovi' | |
| uses: taiki-e/install-action@v2 | |
| with: | |
| tool: cargo-c | |
| - name: Install dependencies | |
| run: .github/workflows/install-dependencies.sh ${{ inputs.lib }} ${{ inputs.platform }} | |
| - name: One Step | |
| run: .github/workflows/onestep.sh ${{ inputs.lib }} ${{ inputs.platform }} ${{ inputs.dryrun }} ${{ inputs.verbose }} | |
| env: | |
| ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} |