Initial ebitengine android project #5
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 | |
| 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 |