Skip to content

Commit d41c4af

Browse files
upd : use gradle, install ndk, jdk
1 parent 1d994ec commit d41c4af

1 file changed

Lines changed: 44 additions & 20 deletions

File tree

Lines changed: 44 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,58 @@
11
name: Build Android
2-
# on: [workflow_call, workflow_dispatch]
2+
# on: [workflow_call, workflow_dispatch]
33
on:
44
push:
55
branches:
66
- ci-actions-android
77

88
jobs:
99
build_android:
10-
timeout-minutes: 30
11-
strategy:
12-
matrix:
13-
preset: ["android-arm64-v8a", "android-armeabi-v7a"]
14-
build-type: [MinSizeRel]
10+
timeout-minutes: 60
1511
runs-on: ubuntu-22.04
1612
steps:
17-
- uses: actions/checkout@v3
13+
- name: Checkout nakama-cpp
14+
uses: actions/checkout@v4
1815
with:
1916
path: nakama-cpp
20-
- uses: ./nakama-cpp/.github/actions/setup-ubuntu
21-
- uses: ./nakama-cpp/.github/actions/setup-vcpkg
22-
with:
23-
github_token: ${{ secrets.github_token }}
24-
vcpkg-path: nakama-cpp/submodules/vcpkg
25-
- uses: ./nakama-cpp/.github/actions/build-library-and-upload
17+
submodules: false
18+
19+
- name: Checkout vcpkg submodule
20+
run: |
21+
git submodule update --init --filter=blob:none -- submodules/vcpkg
22+
working-directory: nakama-cpp
23+
24+
- name: Set up JDK
25+
uses: actions/setup-java@v4
2626
with:
27-
nakama-cpp-path: nakama-cpp
28-
preset: ${{ matrix.preset }}
29-
build-type: ${{ matrix.build-type }}
30-
- if: failure()
31-
uses: ./nakama-cpp/.github/actions/handle-failure
27+
distribution: temurin
28+
java-version: '17'
29+
30+
- name: Install NDK & CMake
31+
run: |
32+
# The GitHub ubuntu-22.04 runner ships with Android SDK at $ANDROID_HOME
33+
sdkmanager --install \
34+
"ndk;27.2.12479018" \
35+
"cmake;4.0.2"
36+
env:
37+
ANDROID_HOME: ${{ env.ANDROID_HOME }}
38+
39+
- name: Add CMake to PATH
40+
run: echo "$ANDROID_HOME/cmake/4.0.2/bin" >> $GITHUB_PATH
41+
42+
- name: Set VCPKG_ROOT
43+
run: echo "VCPKG_ROOT=$GITHUB_WORKSPACE/nakama-cpp/submodules/vcpkg" >> $GITHUB_ENV
44+
45+
- name: Bootstrap vcpkg
46+
run: ./bootstrap-vcpkg.sh -disableMetrics
47+
working-directory: nakama-cpp/submodules/vcpkg
48+
49+
- name: Build with Gradle
50+
run: ./gradlew build --no-daemon
51+
working-directory: nakama-cpp/android
52+
53+
- name: Upload artifacts
54+
uses: actions/upload-artifact@v4
3255
with:
33-
nakama-cpp-path: nakama-cpp
34-
vcpkg-path: nakama-cpp/submodules/vcpkg
56+
name: nakama-sdk-android-aar
57+
path: nakama-cpp/android/nakama-sdk/build/outputs/aar/*.aar
58+
if-no-files-found: error

0 commit comments

Comments
 (0)