Skip to content

remove: debug-ytdl.lua script #80

remove: debug-ytdl.lua script

remove: debug-ytdl.lua script #80

Workflow file for this run

name: build
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
workflow_dispatch:
concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build Android AAR
runs-on: ubuntu-24.04
permissions:
contents: read
env:
CACHE_MODE: folder
CACHE_FOLDER: ${{ github.workspace }}/gh-cache
CCACHE_DIR: ${{ github.workspace }}/.ccache
CCACHE_BASEDIR: ${{ github.workspace }}
CCACHE_MAXSIZE: 5G
CCACHE_COMPRESS: "true"
CCACHE_NOHASHDIR: "true"
CCACHE_DISABLE: "true"
GRADLE_OPTS: >-
-Xmx4G
-Dorg.gradle.daemon=false
-Dorg.gradle.caching=true
-Dorg.gradle.parallel=true
-Dorg.gradle.configureondemand=true
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Java 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: temurin
cache: gradle
- name: Setup Python 3.13
uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Export CI environment variables
run: |
buildscripts/include/ci.sh export >> "$GITHUB_ENV"
- name: Restore Android SDK cache
id: android-sdk-cache
uses: actions/cache/restore@v4
with:
path: buildscripts/sdk/
key: android-sdk-${{ runner.os }}-${{ hashFiles('buildscripts/include/depinfo.sh', 'buildscripts/include/download-sdk.sh') }}
restore-keys: |
android-sdk-${{ runner.os }}-
- name: Restore native prefix cache
id: native-prefix-cache
uses: actions/cache/restore@v4
with:
path: gh-cache/
key: native-prefix-${{ runner.os }}-${{ env.CACHE_IDENTIFIER }}
restore-keys: |
native-prefix-${{ runner.os }}-
- name: Restore ccache
id: ccache-cache
uses: actions/cache/restore@v4
with:
path: .ccache/
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
restore-keys: |
ccache-${{ runner.os }}-${{ github.ref_name }}-
ccache-${{ runner.os }}-
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
autoconf \
automake \
build-essential \
ccache \
gcc g++ \
cmake \
gettext \
gperf \
libtool \
nasm \
ninja-build \
pkg-config \
python3 \
python3-pip \
unzip \
wget
- name: Install Python build dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade meson jinja2 jsonschema
- name: Download and restore native dependencies
run: |
set -euxo pipefail
mkdir -p "$CACHE_FOLDER"
buildscripts/include/ci.sh install
- name: Save Android SDK cache
if: steps.android-sdk-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: buildscripts/sdk/
key: android-sdk-${{ runner.os }}-${{ hashFiles('buildscripts/include/depinfo.sh', 'buildscripts/include/download-sdk.sh') }}
- name: Save native prefix cache
if: steps.native-prefix-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: gh-cache/
key: native-prefix-${{ runner.os }}-${{ env.CACHE_IDENTIFIER }}
- name: Show ccache stats before build
run: |
ccache --zero-stats || true
ccache --show-stats || true
- name: Build AAR for all Android architectures
run: |
set -euxo pipefail
unset ANDROID_SDK_ROOT
cd buildscripts
for arch in armv7l arm64 x86 x86_64; do
./buildall.sh --arch "$arch" -n mpv
done
./buildall.sh -n mpv-android
- name: Show ccache stats after build
if: always()
run: |
ccache --show-stats || true
- name: Save ccache
if: always() && steps.ccache-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: .ccache/
key: ccache-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
- name: Stage AAR artifact
run: |
set -euxo pipefail
mkdir -p dist
AAR_PATH="app/build/outputs/aar/app-release.aar"
if [ ! -f "$AAR_PATH" ]; then
echo "AAR file not found at: $AAR_PATH"
find app/build/outputs -type f || true
exit 1
fi
cp "$AAR_PATH" dist/mpvlib.aar
- name: Upload AAR artifact
uses: actions/upload-artifact@v4
with:
name: mpvlib
path: dist/mpvlib.aar
if-no-files-found: error