|
| 1 | +name: Build for Android (Qt6) |
| 2 | + |
| 3 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 4 | +# events but only for the master branch |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ master ] |
| 8 | + pull_request: |
| 9 | + branches: [ master ] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + runs-on: ubuntu-20.04 |
| 14 | + |
| 15 | + steps: |
| 16 | + - name: Checkout |
| 17 | + uses: actions/checkout@v3 |
| 18 | + with: |
| 19 | + submodules: 'recursive' |
| 20 | + |
| 21 | + - name: Set up JDK 8 |
| 22 | + uses: actions/setup-java@v3 |
| 23 | + with: |
| 24 | + java-version: 8 |
| 25 | + distribution: temurin |
| 26 | + |
| 27 | + - name: Setup Android SDK |
| 28 | + uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc # v2 |
| 29 | + |
| 30 | + - uses: nttld/setup-ndk@8c3b609ff4d54576ea420551943fd34b4d03b0dc # v1 |
| 31 | + id: setup-ndk |
| 32 | + with: |
| 33 | + ndk-version: r25 |
| 34 | + add-to-path: false |
| 35 | + |
| 36 | + - name: Install Qt |
| 37 | + uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 |
| 38 | + with: |
| 39 | + version: '6.4.1' |
| 40 | + host: 'linux' |
| 41 | + target: 'android' |
| 42 | + # Qt 6 only supports multi-arch builds with CMake |
| 43 | + arch: 'android_arm64_v8a' |
| 44 | + cache: true |
| 45 | + |
| 46 | + # Qt 6 for Android needs the desktop version for building as well |
| 47 | + - name: Install Qt (desktop) |
| 48 | + uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 |
| 49 | + with: |
| 50 | + version: '6.4.1' |
| 51 | + host: 'linux' |
| 52 | + target: 'desktop' |
| 53 | + cache: true |
| 54 | + |
| 55 | + - name: Build firebird |
| 56 | + env: |
| 57 | + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} |
| 58 | + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} |
| 59 | + run: | |
| 60 | + mkdir build |
| 61 | + cd build |
| 62 | + qmake .. |
| 63 | + make -j4 apk_install_target |
| 64 | +
|
| 65 | + - name: Pack APK |
| 66 | + env: |
| 67 | + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} |
| 68 | + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} |
| 69 | + ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} |
| 70 | + ANDROID_KEYSTORE_PWD: ${{ secrets.ANDROID_KEYSTORE_PWD }} |
| 71 | + run: | |
| 72 | + cd build |
| 73 | + if [ -n "$ANDROID_KEYSTORE_PWD" ]; then |
| 74 | + echo "$ANDROID_KEYSTORE" | base64 -d > keystore.jks |
| 75 | + androiddeployqt --input android-firebird-emu-deployment-settings.json --output android-build --apk firebird-emu.apk --sign keystore.jks firebirdemugh --storepass "$ANDROID_KEYSTORE_PWD" |
| 76 | + else |
| 77 | + androiddeployqt --input android-firebird-emu-deployment-settings.json --output android-build --apk firebird-emu.apk |
| 78 | + fi |
| 79 | +
|
| 80 | + - name: Upload zip |
| 81 | + uses: actions/upload-artifact@v3 |
| 82 | + with: |
| 83 | + name: firebird-emu-android |
| 84 | + path: build/firebird-emu.apk |
| 85 | + if-no-files-found: error |
0 commit comments