upload both release and debug

This commit is contained in:
Ishan09811 2024-01-25 15:03:20 +05:30 committed by GitHub
parent ef9f87b7fa
commit 145b13ab29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 19 deletions

View file

@ -6,14 +6,16 @@ on:
- master
pull_request:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
x64:
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- Debug
- Release
steps:
- uses: actions/checkout@v2
- name: Fetch submodules
@ -29,30 +31,41 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
distribution: 'zulu' # See 'Supported distributions' for available options
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
run: cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{ matrix.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
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Build the project with CMake
cmake --build ${{github.workspace}}/build --config ${{ matrix.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 assembleDebug
./gradlew assemble${{ matrix.build_type == 'Release' ? 'Release' : 'Debug' }}
cd ../..
- name: Upload executable
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Android APK (x86-64)
path: './src/pandroid/app/build/outputs/apk/debug/app-debug.apk'
name: Android APKs (x86-64)
path: |
./src/pandroid/app/build/outputs/apk/${{ matrix.build_type == 'Release' ? 'release' : 'debug' }}/app-${{ matrix.build_type == 'Release' ? 'release' : 'debug' }}.apk
arm64:
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- Debug
- Release
steps:
- uses: actions/checkout@v2
- name: Fetch submodules
@ -68,24 +81,28 @@ jobs:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu' # See 'Supported distributions' for available options
distribution: 'zulu' # See 'Supported distributions' for available options
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"
run: cmake -B ${{github.workspace}}/build -DBUILD_HYDRA_CORE=1 -DCMAKE_BUILD_TYPE=${{ matrix.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
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
# Build the project with CMake
cmake --build ${{github.workspace}}/build --config ${{ matrix.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 assembleDebug
./gradlew assemble${{ matrix.build_type == 'Release' ? 'Release' : 'Debug' }}
cd ../..
- name: Upload executable
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: Android APK (arm64)
path: './src/pandroid/app/build/outputs/apk/debug/app-debug.apk'
name: Android APKs (arm64)
path: |
./src/pandroid/app/build/outputs/apk/${{ matrix.build_type == 'Release' ? 'release' : 'debug' }}/app-${{ matrix.build_type == 'Release' ? 'release' : 'debug' }}.apk

View file

@ -29,6 +29,14 @@ android {
"proguard-rules.pro"
)
}
debug {
minifyEnabled false
shrinkResources false
debuggable true
proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8