From 6ef47f3793a2872bc9e42c962d7ebc493f5d0bcf Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Tue, 27 Dec 2022 16:35:12 +0100 Subject: [PATCH] Add workflows for Qt 6 --- .github/workflows/android-qt6.yml | 85 +++++++++++++++++++++++++++++++ .github/workflows/macOS.yml | 13 ++--- .github/workflows/windows.yml | 44 +++++++++++----- 3 files changed, 124 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/android-qt6.yml diff --git a/.github/workflows/android-qt6.yml b/.github/workflows/android-qt6.yml new file mode 100644 index 00000000..fb4a30c5 --- /dev/null +++ b/.github/workflows/android-qt6.yml @@ -0,0 +1,85 @@ +name: Build for Android (Qt6) + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: 'recursive' + + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: 8 + distribution: temurin + + - name: Setup Android SDK + uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc # v2 + + - uses: nttld/setup-ndk@8c3b609ff4d54576ea420551943fd34b4d03b0dc # v1 + id: setup-ndk + with: + ndk-version: r25 + add-to-path: false + + - name: Install Qt + uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 + with: + version: '6.4.1' + host: 'linux' + target: 'android' + # Qt 6 only supports multi-arch builds with CMake + arch: 'android_arm64_v8a' + cache: true + + # Qt 6 for Android needs the desktop version for building as well + - name: Install Qt (desktop) + uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 + with: + version: '6.4.1' + host: 'linux' + target: 'desktop' + cache: true + + - name: Build firebird + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} + run: | + mkdir build + cd build + qmake .. + make -j4 apk_install_target + + - name: Pack APK + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }} + ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }} + ANDROID_KEYSTORE_PWD: ${{ secrets.ANDROID_KEYSTORE_PWD }} + run: | + cd build + if [ -n "$ANDROID_KEYSTORE_PWD" ]; then + echo "$ANDROID_KEYSTORE" | base64 -d > keystore.jks + androiddeployqt --input android-firebird-emu-deployment-settings.json --output android-build --apk firebird-emu.apk --sign keystore.jks firebirdemugh --storepass "$ANDROID_KEYSTORE_PWD" + else + androiddeployqt --input android-firebird-emu-deployment-settings.json --output android-build --apk firebird-emu.apk + fi + + - name: Upload zip + uses: actions/upload-artifact@v3 + with: + name: firebird-emu-android + path: build/firebird-emu.apk + if-no-files-found: error diff --git a/.github/workflows/macOS.yml b/.github/workflows/macOS.yml index 8266e875..5d329482 100644 --- a/.github/workflows/macOS.yml +++ b/.github/workflows/macOS.yml @@ -2,20 +2,20 @@ name: Build macOS on: push: - branches: [ master, ci/macOS ] + branches: [ master ] pull_request: - branches: [ master, ci/macOS ] + branches: [ master ] release: types: [published] jobs: build: - name: "Build: ${{ matrix.os }}" - runs-on: ${{ matrix.os }} + name: "Qt ${{ matrix.qt }}" + runs-on: macOS-latest strategy: fail-fast: false matrix: - os: [macOS-latest] + qt: [ "5.15.2", "6.4.1" ] steps: - name: Checkout Git Repo @@ -26,6 +26,7 @@ jobs: - name: Install Qt uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 with: + version: "${{ matrix.qt }}" target: desktop setup-python: false @@ -93,5 +94,5 @@ jobs: - name: "Upload DMG" uses: actions/upload-artifact@v3 with: - name: firebird-emu_macOS + name: "firebird-emu_macOS-Qt${{ matrix.qt }}" path: firebird-emu_macOS.dmg diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6a5437b1..da52433f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -2,22 +2,29 @@ name: Build for Windows on: push: - branches: [ master, ci/windows ] + branches: [ master ] pull_request: - branches: [ master, ci/windows ] + branches: [ master ] release: types: [published] jobs: build: - name: "Build: ${{ matrix.arch }}" + name: "Qt ${{ matrix.qt }} ${{ matrix.arch }}" runs-on: windows-2022 strategy: fail-fast: false matrix: - arch: - - win32 - - win64 + include: + - qt: '5.15.2' + qtmaj: '5' + arch: 'win32' + - qt: '5.15.2' + qtmaj: '5' + arch: 'win64' + - qt: '6.4.1' + qtmaj: '6' + arch: 'win64' steps: - name: Checkout Git Repo @@ -25,20 +32,33 @@ jobs: with: submodules: 'recursive' - - name: Install Qt + - name: "Install Qt ${{ matrix.qt }}" uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 + if: matrix.qtmaj == '5' with: - version: '5.15.2' + version: '${{ matrix.qt }}' host: 'windows' target: 'desktop' arch: '${{ matrix.arch }}_mingw81' tools: 'tools_mingw,qt.tools.${{ matrix.arch }}_mingw810' cache: true + - name: "Install Qt ${{ matrix.qt }}" + uses: jurplel/install-qt-action@43ec12788e42f375acfcb2cec059edfb9572fbaa # v3 + if: matrix.qtmaj != '5' + with: + version: '${{ matrix.qt }}' + host: 'windows' + target: 'desktop' + arch: '${{ matrix.arch }}_mingw' + tools: 'tools_mingw90' + cache: true + - name: Fixup PATH run: | echo "$env:IQTA_TOOLS/mingw810_32/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "$env:IQTA_TOOLS/mingw810_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "$env:IQTA_TOOLS/mingw1120_64/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Build firebird-emu run: | @@ -53,7 +73,7 @@ jobs: - name: Upload zip uses: actions/upload-artifact@v3 with: - name: firebird-emu-${{ matrix.arch }} - # Use a wildcard to force a subfolder - path: "build/*-emu/" - if-no-files-found: error + name: firebird-emu-Qt${{ matrix.qtmaj }}-${{ matrix.arch }} + # Use a wildcard to force a subfolder + path: "build/*-emu/" + if-no-files-found: error