Merge pull request #334 from wheremyfoodat/delete-emu #14
This file contains 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: Android Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
jobs: | |
x64: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
build_type: | |
- release | |
steps: | |
- name: Set BUILD_TYPE variable | |
run: echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- name: Fetch submodules | |
run: git submodule update --init --recursive | |
- name: Setup Vulkan SDK | |
uses: humbletim/[email protected] | |
with: | |
vulkan-query-version: latest | |
vulkan-use-cache: true | |
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
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 | |
- 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 }} | |
# Move the generated library to the appropriate location | |
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@v2 | |
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-latest | |
strategy: | |
matrix: | |
build_type: | |
- release | |
steps: | |
- name: Set BUILD_TYPE variable | |
run: echo "BUILD_TYPE=${{ matrix.build_type }}" >> $GITHUB_ENV | |
- uses: actions/checkout@v2 | |
- name: Fetch submodules | |
run: git submodule update --init --recursive | |
- name: Setup Vulkan SDK | |
uses: humbletim/[email protected] | |
with: | |
vulkan-query-version: latest | |
vulkan-use-cache: true | |
vulkan-components: Vulkan-Headers, Vulkan-Loader, SPIRV-Tools, Glslang | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
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" | |
- 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 }} | |
# Move the generated library to the appropriate location | |
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@v2 | |
with: | |
name: Android APKs (arm64) | |
path: | | |
./src/pandroid/app/build/outputs/apk/${{ env.BUILD_TYPE }}/app-${{ env.BUILD_TYPE }}.apk |