From 4f1b22c668bc3ebe51052e85816fc515795d40ad Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 20 Jun 2024 19:20:53 +0200 Subject: [PATCH 1/5] GHA: Add GDExtension Android libs to build workflow --- .github/workflows/gdextension.yml | 46 +++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gdextension.yml b/.github/workflows/gdextension.yml index cfcf47a..3a3d842 100644 --- a/.github/workflows/gdextension.yml +++ b/.github/workflows/gdextension.yml @@ -104,6 +104,34 @@ jobs: arch: wasm32 should-build: true + - name: 🤖 Android (arm64, release) + runner: ubuntu-20.04 + platform: android + target: template_release + arch: arm64 + should-build: true + + - name: 🤖 Android (arm64, debug) + runner: ubuntu-20.04 + platform: android + target: template_debug + arch: arm64 + should-build: true + + - name: 🤖 Android (x86_64, release) + runner: ubuntu-20.04 + platform: android + target: template_release + arch: x86_64 + should-build: true + + - name: 🤖 Android (x86_64, debug) + runner: ubuntu-20.04 + platform: android + target: template_debug + arch: x86_64 + should-build: true + exclude: - { opts: { should-build: false } } @@ -166,13 +194,27 @@ jobs: emcc -v - name: Set up scons - if: matrix.opts.platform == 'windows' || matrix.opts.platform == 'macos' || matrix.opts.platform == 'web' + if: matrix.opts.platform != 'linux' run: | python -c "import sys; print(sys.version)" python -m pip install scons==4.4.0 python --version scons --version + - name: Set up Java 17 + if: matrix.opts.platform == 'android' + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 17 + + - uses: nttld/setup-ndk@v1 + if: matrix.opts.platform == 'android' + id: setup-ndk + with: + ndk-version: r23c + link-to-sdk: true + - name: Set up MSVC problem matcher on Windows if: matrix.opts.platform == 'windows' uses: ammaraskar/msvc-problem-matcher@master @@ -218,7 +260,7 @@ jobs: ls -R out/ - name: Strip lib - if: matrix.opts.platform != 'windows' && matrix.opts.platform != 'web' + if: matrix.opts.platform != 'windows' && matrix.opts.platform != 'web' && (matrix.opts.platform != 'android' || matrix.opts.arch != 'arm64') run: | ls -l -R out/addons/limboai/bin/ echo "---" From d383e9d1a4a776b2f1afd91c1c843705dea31573 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Thu, 20 Jun 2024 19:54:14 +0200 Subject: [PATCH 2/5] GHA: Don't build web and android libs in test builds --- .github/workflows/gdextension.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gdextension.yml b/.github/workflows/gdextension.yml index 3a3d842..7fd773c 100644 --- a/.github/workflows/gdextension.yml +++ b/.github/workflows/gdextension.yml @@ -95,42 +95,42 @@ jobs: platform: web target: template_release arch: wasm32 - should-build: true + should-build: ${{ !inputs.test-build }} - name: 🌐 Web (wasm32, debug) runner: ubuntu-20.04 platform: web target: template_debug arch: wasm32 - should-build: true + should-build: ${{ !inputs.test-build }} - name: 🤖 Android (arm64, release) runner: ubuntu-20.04 platform: android target: template_release arch: arm64 - should-build: true + should-build: ${{ !inputs.test-build }} - name: 🤖 Android (arm64, debug) runner: ubuntu-20.04 platform: android target: template_debug arch: arm64 - should-build: true + should-build: ${{ !inputs.test-build }} - name: 🤖 Android (x86_64, release) runner: ubuntu-20.04 platform: android target: template_release arch: x86_64 - should-build: true + should-build: ${{ !inputs.test-build }} - name: 🤖 Android (x86_64, debug) runner: ubuntu-20.04 platform: android target: template_debug arch: x86_64 - should-build: true + should-build: ${{ !inputs.test-build }} exclude: - { opts: { should-build: false } } From 2784937ca8c0af500be90bec7a1b4da1af5f257a Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 21 Jun 2024 10:18:15 +0200 Subject: [PATCH 3/5] GHA: Build Android libs for arm32 & x86_32 --- .github/workflows/gdextension.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/gdextension.yml b/.github/workflows/gdextension.yml index 7fd773c..e3287eb 100644 --- a/.github/workflows/gdextension.yml +++ b/.github/workflows/gdextension.yml @@ -118,6 +118,20 @@ jobs: arch: arm64 should-build: ${{ !inputs.test-build }} + - name: 🤖 Android (arm32, release) + runner: ubuntu-20.04 + platform: android + target: template_release + arch: arm32 + should-build: ${{ !inputs.test-build }} + + - name: 🤖 Android (arm32, debug) + runner: ubuntu-20.04 + platform: android + target: template_debug + arch: arm32 + should-build: ${{ !inputs.test-build }} + - name: 🤖 Android (x86_64, release) runner: ubuntu-20.04 platform: android @@ -132,6 +146,20 @@ jobs: arch: x86_64 should-build: ${{ !inputs.test-build }} + - name: 🤖 Android (x86_32, release) + runner: ubuntu-20.04 + platform: android + target: template_release + arch: x86_32 + should-build: ${{ !inputs.test-build }} + + - name: 🤖 Android (x86_32, debug) + runner: ubuntu-20.04 + platform: android + target: template_debug + arch: x86_32 + should-build: ${{ !inputs.test-build }} + exclude: - { opts: { should-build: false } } From 5bdec804b39a8351813351af602e800ded0a9158 Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 21 Jun 2024 10:31:30 +0200 Subject: [PATCH 4/5] Add 32-bit Android libs to GDExtension manifest --- gdextension/limboai.gdextension | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gdextension/limboai.gdextension b/gdextension/limboai.gdextension index 604181b..4cea5dd 100644 --- a/gdextension/limboai.gdextension +++ b/gdextension/limboai.gdextension @@ -17,10 +17,14 @@ linux.debug.arm64 = "res://addons/limboai/bin/liblimboai.linux.editor.arm64.so" linux.release.arm64 = "res://addons/limboai/bin/liblimboai.linux.template_release.arm64.so" linux.debug.rv64 = "res://addons/limboai/bin/liblimboai.linux.editor.rv64.so" linux.release.rv64 = "res://addons/limboai/bin/liblimboai.linux.template_release.rv64.so" -android.debug.x86_64 = "res://addons/limboai/bin/liblimboai.android.template_debug.x86_64.so" -android.release.x86_64 = "res://addons/limboai/bin/liblimboai.android.template_release.x86_64.so" android.debug.arm64 = "res://addons/limboai/bin/liblimboai.android.template_debug.arm64.so" android.release.arm64 = "res://addons/limboai/bin/liblimboai.android.template_release.arm64.so" +android.debug.arm32 = "res://addons/limboai/bin/liblimboai.android.template_debug.arm32.so" +android.release.arm32 = "res://addons/limboai/bin/liblimboai.android.template_release.arm32.so" +android.debug.x86_64 = "res://addons/limboai/bin/liblimboai.android.template_debug.x86_64.so" +android.release.x86_64 = "res://addons/limboai/bin/liblimboai.android.template_release.x86_64.so" +android.debug.x86_32 = "res://addons/limboai/bin/liblimboai.android.template_debug.x86_32.so" +android.release.x86_32 = "res://addons/limboai/bin/liblimboai.android.template_release.x86_32.so" web.debug.wasm32 = "res://addons/limboai/bin/liblimboai.web.template_debug.wasm32.wasm" web.release.wasm32 = "res://addons/limboai/bin/liblimboai.web.template_release.wasm32.wasm" From b712fe25dc0c5ed6076f890dd073da83b32e88ae Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 21 Jun 2024 10:34:36 +0200 Subject: [PATCH 5/5] GHA: Don't strip arm Android libs --- .github/workflows/gdextension.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gdextension.yml b/.github/workflows/gdextension.yml index e3287eb..44db582 100644 --- a/.github/workflows/gdextension.yml +++ b/.github/workflows/gdextension.yml @@ -288,7 +288,7 @@ jobs: ls -R out/ - name: Strip lib - if: matrix.opts.platform != 'windows' && matrix.opts.platform != 'web' && (matrix.opts.platform != 'android' || matrix.opts.arch != 'arm64') + if: matrix.opts.platform != 'windows' && matrix.opts.platform != 'web' && (matrix.opts.platform != 'android' || startsWith(matrix.opts.arch, 'x86')) run: | ls -l -R out/addons/limboai/bin/ echo "---"