-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (52 loc) · 1.83 KB
/
ci.yaml
File metadata and controls
62 lines (52 loc) · 1.83 KB
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
name: Build APK
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Install ARM cross-compilers
run: |
sudo apt-get update
sudo apt-get install -y gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
sdk-platform: "android-34"
sdk-build-tools: "34.0.0"
- name: Install Android NDK
run: |
# Install NDK using sdkmanager (more reliable)
yes | sdkmanager --install "ndk;26.2.11394342"
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/26.2.11394342" >> $GITHUB_ENV
chmod -R +r $ANDROID_NDK_HOME
- name: Verify NDK installation
run: |
ls -la $ANDROID_NDK_HOME
ls -la $ANDROID_NDK_HOME/meta
- name: Install gomobile
run: |
go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init
- name: Build Android package (ARM only)
run: |
cd $GITHUB_WORKSPACE
gomobile build \
-target=android/arm,android/arm64 \
-androidapi=34 \
-o game.apk \
./cmd/game
- name: Upload APK
uses: actions/upload-artifact@v4
with:
name: game-apk
path: game.apk