Add build workflow #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 Android APK | |
| on: | |
| push: | |
| branches: [dev] | |
| pull_request: | |
| branches: [dev] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| SDK_VERSION: 34 | |
| NDK_VERSION: 27.0.11718014 | |
| MIN_SDK: 29 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: "temurin" | |
| java-version: "17" | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Install NDK | |
| run: | | |
| sdkmanager "ndk;$NDK_VERSION" | |
| sdkmanager "cmake;3.22.1" | |
| - name: Grant execute permission to Gradle wrapper | |
| run: chmod +x ./gradlew | |
| - name: Build Debug APK | |
| run: ./gradlew assembleDebug | |
| - name: Upload APK artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: testgame-apk | |
| path: app/build/outputs/apk/debug/app-debug.apk |