Initial ebitengine android project #4
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 Android 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: Install Android NDK | |
| run: | | |
| # Download and extract NDK directly | |
| wget https://dl.google.com/android/repository/android-ndk-r26b-linux.zip | |
| unzip android-ndk-r26b-linux.zip -d $ANDROID_SDK_ROOT/ndk | |
| mv $ANDROID_SDK_ROOT/ndk/android-ndk-r26b $ANDROID_SDK_ROOT/ndk/26.2.11394342 | |
| echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/26.2.11394342" >> $GITHUB_ENV | |
| - name: Set up Android SDK | |
| uses: android-actions/setup-android@v2 | |
| with: | |
| sdk-platform: "android-34" | |
| sdk-build-tools: "34.0.0" | |
| - 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: testplatformer.apk |