Initial ebitengine android project #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build APK (ARM only) | |
| 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 environment | |
| uses: android-actions/setup-android@v2 | |
| with: | |
| ndk-version: "25.2.9519653" # Verified working version | |
| sdk-platform: "android-34" | |
| sdk-build-tools: "34.0.0" | |
| - name: Configure environment | |
| run: | | |
| echo "ANDROID_HOME=$ANDROID_SDK_ROOT" >> $GITHUB_ENV | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/25.2.9519653" >> $GITHUB_ENV | |
| echo "$GOPATH/bin" >> $GITHUB_PATH | |
| - name: List installed SDK packages | |
| run: | | |
| $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --list_installed | |
| - name: List installed NDK versions | |
| run: | | |
| ls -la $ANDROID_SDK_ROOT/ndk/ | |
| - 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 | |
| run: | | |
| cd $GITHUB_WORKSPACE | |
| go mod tidy | |
| 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 |