forked from freeorion/freeorion
-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (69 loc) · 2.79 KB
/
_build-android.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: "Android"
on:
workflow_call:
jobs:
generate-godot-api:
name: Generate Godot API
runs-on: ubuntu-22.04
container:
image: ghcr.io/bend-n/godot:3.5.2
steps:
- name: Setup
uses: bend-n/godot-actions/.github/actions/setup-godot@main
env:
GODOT_VERSION: 3.5.2
- name: Generate API file
run: |
timeout 1m godot --no-window --disable-render-loop --video-driver Dummy --gdnative-generate-json-api godot-api.json
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: godot-api
path: godot-api.json
if-no-files-found: error
retention-days: 1
android:
name: ${{ matrix.arch }}
runs-on: ubuntu-latest
needs: generate-godot-api
strategy:
matrix:
arch: [x86, x86_64, armeabi-v7a, arm64-v8a]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Dowload Godot API
uses: actions/download-artifact@v4
with:
name: godot-api
path: .
- name: Download SDK
id: download-sdk
uses: suisei-cn/actions-download-file@v1.4.0
with:
url: https://github.com/freeorion/freeorion-sdk/releases/download/v15/FreeOrionSDK_15_Android-${{ matrix.arch }}.zip
target: ../
- uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r24
add-to-path: false
- name: Configure
run: |
unzip -q ../${{ steps.download-sdk.outputs.filename }} -d ..
GODOT_API_JSON=$(realpath godot-api.json)
mkdir build
pushd build
FO_SDK=$(realpath ../..)
cmake -DANDROID_ABI=${{ matrix.arch }} -DANDROID_PLATFORM=24 -DANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }} -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=${{ steps.setup-ndk.outputs.ndk-path }}/build/cmake/android.toolchain.cmake -DCMAKE_CXX_FLAGS=-std=c++14 -DANDROID_ALLOW_UNDEFINED_SYMBOLS=Off -DBUILD_SERVER=OFF -DBUILD_AI=OFF -DBUILD_CLIENT_GG=OFF -DBoost_INCLUDE_DIR=${FO_SDK}/include/ -DBoost_USE_STATIC_LIBS=On -DBoost_LIBRARY_DIR=${FO_SDK}/lib/ -DBUILD_CLIENT_GODOT=On -DICUI18N_LIBRARY=${FO_SDK}/lib/libicui18n.a -DICUUC_LIBRARY=${FO_SDK}/lib/libicuuc.a -DICUDATA_LIBRARY=${FO_SDK}/lib/libicudata.a -DICONV_LIBRARY=${FO_SDK}/lib/libiconv.so -DPython3_LIBRARY=${FO_SDK}/lib/libpython3.9.a -DPython3_INCLUDE_DIR=${FO_SDK}/include/python3.9/ -DGODOT_CUSTOM_API_FILE=${GODOT_API_JSON} ..
- name: Build
run: |
pushd build
cmake --build . -- -j2
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
name: android-binaries-${{ matrix.arch }}
path: godot/bin/
if-no-files-found: error
retention-days: 1