From 9eccb14e86d18a163791917f2ac08c395bacf447 Mon Sep 17 00:00:00 2001 From: devseed Date: Sat, 25 Feb 2023 18:39:17 +0900 Subject: [PATCH] make android ci --- .github/workflows/build_android.yml | 31 +++++++++++++++++++ .gitignore | 3 +- README.md | 6 ++-- script/cross_android.sh | 7 +++-- src/onsyuri_android/.idea/vcs.xml | 25 +++++++++++++++ src/onsyuri_android/app/build.gradle | 5 ++- .../app/res/values/strings.xml | 2 +- 7 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/build_android.yml diff --git a/.github/workflows/build_android.yml b/.github/workflows/build_android.yml new file mode 100644 index 0000000..bbd6aba --- /dev/null +++ b/.github/workflows/build_android.yml @@ -0,0 +1,31 @@ +name: build android +on: + push: {tags: ['v*']} # Push events to matching v*, i.e. v1.0, v20.15.10 + +permissions: + contents: write + +env: + BUILD_NAME: onsyuri_android + +jobs: + build_android: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'temurin' + cache: gradle + + - name: build onsyuri_android + run: cd script && bash ./cross_android.sh + + - name: create release + uses: ncipollo/release-action@v1 + with: + artifacts: "./build_android/outputs/apk/debug/*.apk" + allowUpdates: "true" + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 5b6f8b1..24c318f 100644 --- a/.gitignore +++ b/.gitignore @@ -19,4 +19,5 @@ src/onsyuri_android/.idea/navEditor.xml src/onsyuri_android/.idea/assetWizardSettings.xml src/onsyuri_android/.idea/deploymentTargetDropDown.xml src/onsyuri_android/.idea/inspectionProfiles -src/onsyuri_android/app/cpp/thirdparty/* \ No newline at end of file +src/onsyuri_android/app/cpp/thirdparty/** +src/onsyuri_android/app/.cxx/** \ No newline at end of file diff --git a/README.md b/README.md index 36433a8..8e7df96 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Onscripter (Yuri) +# Onscripter-Yuri -![GitHub release (latest by date)](https://img.shields.io/github/v/release/YuriSizuku/OnscripterYuri?color=green&label=OnsYuri&logo=4chan&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_web.yml?label=web&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_win.yml?label=win(x86|x64)&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_linux.yml?label=linux(x86|x64|arm32|arm64)&style=flat-square) +![GitHub release (latest by date)](https://img.shields.io/github/v/release/YuriSizuku/OnscripterYuri?color=green&label=onsyuri&logo=4chan&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_web.yml?label=web&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_win.yml?label=win(x86|x64)&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_linux.yml?label=linux(x86|x64|arm|arm64)&style=flat-square) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/YuriSizuku/OnscripterYuri/build_android.yml?label=android(arm|arm64)&style=flat-square) ☘️ An ehancement Onscripter porting to many platforms, especially **web** ! We also support for `windows`, `linux`, `android` and `psv`. This project is base on [ONScripter-Jh](https://github.com/jh10001/ONScripter-Jh) by `SDL2`. @@ -292,4 +292,4 @@ chmod +x ./gradlew && ./gradlew assembleDebug ## 5. Todo - video support (future plan) -- preloading (future plan) \ No newline at end of file +- preloading (future plan) diff --git a/script/cross_android.sh b/script/cross_android.sh index 0d8a960..37fa7ad 100644 --- a/script/cross_android.sh +++ b/script/cross_android.sh @@ -1,4 +1,4 @@ -# bash -c "export BUILD_TYPE=Debug && export SKIP_PORTS=1 && ./cross_linuxa64.sh" +# bash -c "export SKIP_PORTS=yes && ./cross_android.sh" PLATFORM=android BUILD_PATH=./../build_${PLATFORM} CMAKELISTS_PATH=$(pwd)/.. @@ -36,7 +36,8 @@ fi if [ -z "$BUILD_TYPE" ]; then BUILD_TYPE=MinSizeRel; fi if [ -z "$TARGETS" ]; then TARGETS=assembleDebug; fi + pushd ${CMAKELISTS_PATH}/src/onsyuri_android -# use gradlew.bat in windows, or it might failed -chmod +x ./gradlew && ./gradlew $TARGETS +echo "ANDROID_HOME=$ANDROID_HOME" # use ANDROID_HOME or local.properties +chmod +x ./gradlew && ./gradlew $TARGETS --no-daemon popd \ No newline at end of file diff --git a/src/onsyuri_android/.idea/vcs.xml b/src/onsyuri_android/.idea/vcs.xml index db5a9e0..697cb7f 100644 --- a/src/onsyuri_android/.idea/vcs.xml +++ b/src/onsyuri_android/.idea/vcs.xml @@ -26,5 +26,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/onsyuri_android/app/build.gradle b/src/onsyuri_android/app/build.gradle index 9b86c0a..5c0647e 100644 --- a/src/onsyuri_android/app/build.gradle +++ b/src/onsyuri_android/app/build.gradle @@ -21,7 +21,6 @@ android { } ndk { abiFilters 'armeabi-v7a', 'arm64-v8a' - debugSymbolLevel 'FULL' } externalNativeBuild { cmake { @@ -43,7 +42,6 @@ android { debug { minifyEnabled false debuggable true - jniDebuggable true } } @@ -58,7 +56,8 @@ android { cmake { version '3.22.1' path 'cpp/CMakeLists.txt' - buildStagingDirectory './../../../build_android' + // this might be some problem with ninja + // buildStagingDirectory './../../../build_android' } } android.applicationVariants.all { variant -> diff --git a/src/onsyuri_android/app/res/values/strings.xml b/src/onsyuri_android/app/res/values/strings.xml index 54e2676..189b7f9 100644 --- a/src/onsyuri_android/app/res/values/strings.xml +++ b/src/onsyuri_android/app/res/values/strings.xml @@ -2,7 +2,7 @@ ONScripter-Yuri v0.7.0 - An enhancement of ONScripter, developed by YuriSizuku \n + An enhancement of ONScripter, developed by YuriSizuku \n\n 1. Game Dir \n use SAF or put game files in app, ext app dir \n /storage/emulated/0/Android/data/com.yuri.onscripter/files \n