mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 06:05:40 +12:00
145 lines
4.6 KiB
YAML
145 lines
4.6 KiB
YAML
name: Android Build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
x64:
|
|
runs-on: ubuntu-24.04
|
|
|
|
strategy:
|
|
matrix:
|
|
build_type:
|
|
- release
|
|
|
|
steps:
|
|
- name: Set BUILD_TYPE variable
|
|
run: echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v4
|
|
- name: Fetch submodules
|
|
run: git submodule update --init --recursive
|
|
|
|
- name: Setup CCache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
- name: Set up gradle caches
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-pandroid-x86_64-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pandroid-x86_64-
|
|
|
|
- name: Setup Vulkan SDK
|
|
uses: humbletim/setup-vulkan-sdk@main
|
|
with:
|
|
vulkan-query-version: 1.3.296.0
|
|
vulkan-use-cache: true
|
|
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: Configure CMake
|
|
run: cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=x86_64 -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
|
|
- name: Build
|
|
run: |
|
|
# Apply patch for GLES compatibility
|
|
git apply ./.github/gles.patch
|
|
# Build the project with CMake
|
|
cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }}
|
|
|
|
# Strip the generated library and move it to the appropriate location
|
|
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/libAlber.so
|
|
mv ./build/libAlber.so ./src/pandroid/app/src/main/jniLibs/x86_64/
|
|
|
|
# Build the Android app with Gradle
|
|
cd src/pandroid
|
|
./gradlew assemble${{ env.BUILD_TYPE }}
|
|
cd ../..
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Android APKs (x86-64)
|
|
path: |
|
|
./src/pandroid/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
|
|
|
|
arm64:
|
|
runs-on: ubuntu-24.04
|
|
|
|
strategy:
|
|
matrix:
|
|
build_type:
|
|
- release
|
|
|
|
steps:
|
|
- name: Set BUILD_TYPE variable
|
|
run: echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV
|
|
|
|
- uses: actions/checkout@v4
|
|
- name: Fetch submodules
|
|
run: git submodule update --init --recursive
|
|
|
|
- name: Setup CCache
|
|
uses: hendrikmuhs/ccache-action@v1.2
|
|
|
|
- name: Set up gradle caches
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-pandroid-arm64-${{ github.sha }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pandroid-arm64-
|
|
|
|
- name: Setup Vulkan SDK
|
|
uses: humbletim/setup-vulkan-sdk@main
|
|
with:
|
|
vulkan-query-version: 1.3.296.0
|
|
vulkan-use-cache: true
|
|
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: Configure CMake
|
|
run: cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake -DANDROID_ABI=arm64-v8a -DENABLE_VULKAN=0 -DENABLE_USER_BUILD=ON -DCMAKE_CXX_FLAGS="-march=armv8-a+crypto" -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
|
|
|
|
- name: Build
|
|
run: |
|
|
# Apply patch for GLES compatibility
|
|
git apply ./.github/gles.patch
|
|
# Build the project with CMake
|
|
cmake --build ${{github.workspace}}/build --config ${{ env.BUILD_TYPE }}
|
|
|
|
# Strip the generated library and move it to the appropriate location
|
|
${ANDROID_NDK_ROOT}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded ./build/libAlber.so
|
|
mv ./build/libAlber.so ./src/pandroid/app/src/main/jniLibs/arm64-v8a/
|
|
|
|
# Build the Android app with Gradle
|
|
cd src/pandroid
|
|
./gradlew assemble${{ env.BUILD_TYPE }}
|
|
ls -R app/build/outputs
|
|
cd ../..
|
|
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: Android APKs (arm64)
|
|
path: |
|
|
./src/pandroid/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk
|