Skip to content

fix android project path #93

fix android project path

fix android project path #93

name: cmake-desktop-multiplatform-workflow
on:
push:
branches: ["main"]
paths:
- 'src/**'
- 'include/**'
- 'cmake/**'
- '**/*.cmake'
- '**/*.cpp'
- '**/*.hpp'
- '**/*.c'
- '**/*.h'
- '**/*.cxx'
- '**/*.hxx'
- 'CMakeLists.txt'
- '**/*CMakeLists*.txt'
- '**/*CMakePresets.json'
- '.github/workflows/**'
- 'android-project/**'
pull_request:
branches: ["main"]
paths:
- 'src/**'
- 'include/**'
- 'cmake/**'
- '**/*.cmake'
- '**/*.cpp'
- '**/*.hpp'
- '**/*.c'
- '**/*.h'
- '**/*.cxx'
- '**/*.hxx'
- 'CMakeLists.txt'
- '**/*CMakeLists*.txt'
- '**/CMakePresets.json'
- '.github/workflows/**'
- 'android-project/**'
jobs:
build-package:
runs-on: ${{ matrix.os }}
env:
CMAKE_BUILD_PARALLEL_LEVEL: "8"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
include:
- os: ubuntu-latest
preset: clang-full
- os: windows-latest
preset: msvc-full
steps:
- uses: actions/checkout@v4
- name: Install Linux deps
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends \
libwayland-dev \
libxkbcommon-dev \
libegl1-mesa-dev \
libgles2-mesa-dev \
libgl1-mesa-dev \
libdbus-1-dev \
libudev-dev \
libasound2-dev \
ninja-build \
clang
- name: Configure CMake
run: cmake --workflow --preset ${{ matrix.preset }}
- name: Upload ZIP artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.preset }}-zip
path: build/*/*.zip
if-no-files-found: ignore
- name: Upload TAR.GZ artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.preset }}-tar-gz
path: build/*/*.tar.gz
if-no-files-found: ignore
- name: Upload RPM artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}-${{ matrix.preset }}-rpm
path: build/*/*.rpm
if-no-files-found: ignore
build-apk:
runs-on: ubuntu-latest
strategy:
matrix:
# todo: setup keys for release
# todo: add multi arch build (64 bit)
build-type: [debug] # todo: relese
abi: [x86_64] # todo: arm64-v8a
include:
- build-type: debug
gradle-task: assembleDebug
env:
ANDROID_PROJECT_DIR: android-project
GRADLE_OPTS: -Dorg.gradle.daemon=false -Dorg.gradle.parallel=true -Dorg.gradle.configureondemand=true
CMAKE_BUILD_PARALLEL_LEVEL: 8
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: "17"
distribution: "temurin"
cache: gradle
- name: make gradlew executable
run: chmod +x "${{ env.ANDROID_PROJECT_DIR }}/gradlew"
- name: build android ${{ matrix.build-type }} (${{ matrix.abi }})
working-directory: ${{ env.ANDROID_PROJECT_DIR }}
run: |
./gradlew --no-daemon --stacktrace clean :app:${{ matrix.gradle-task }} \
-Pandroid.injected.build.abi=${{ matrix.abi }}
- name: Upload APK artifacts
uses: actions/upload-artifact@v4
with:
name: android-${{ matrix.abi }}-${{ matrix.build-type }}-apk
path: |
${{ env.ANDROID_PROJECT_DIR }}/app/build/intermediates/apk/${{ matrix.build-type }}/*.apk