Skip to content

Commit

Permalink
Update Github Actions workflows for Qt6
Browse files Browse the repository at this point in the history
* Update MacOS test builds to test both Qt5 and Qt6. However, due to
  Homebrew/brew#15354, macdeployqt is still
  broken for Qt6 on Homebrew, so MacOS release builds will continue to
  use Qt5 instead.
* Update Windows test builds to test Qt5 for i686 and Qt6 for x86_64
* Update Windows release build to use MinGW. This more closely matches
  the Qt builds and partially reverts 7cab5e2.
* Update Windows release build to use Qt6
* Update README to mention CMAKE_PREFIX_PATH because this appears to be
  necessary for Windows release builds that use a standalone Qt
  installation
  • Loading branch information
leonlynch committed Sep 20, 2023
1 parent 21d653b commit 8267a4b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/macos-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ jobs:
include:
- { name: "MacOS 11", os: macos-11, osx_arch: "x86_64;arm64", build_type: "Release", deps: "none", fetch_deps: YES, build_dukpt_ui: NO }
- { name: "MacOS 11", os: macos-11, osx_arch: "x86_64;arm64", build_type: "Debug", deps: "tr31", fetch_deps: YES, build_dukpt_ui: NO }
- { name: "MacOS 11", os: macos-11, osx_arch: "x86_64", build_type: "Release", deps: "tr31/qt", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 11", os: macos-11, osx_arch: "x86_64", build_type: "Debug", deps: "tr31/qt5", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 11", os: macos-11, osx_arch: "x86_64", build_type: "Release", deps: "tr31/qt6", fetch_deps: NO, build_dukpt_ui: YES }
- { name: "MacOS 12", os: macos-12, osx_arch: "x86_64", build_type: "Release", deps: "tr31", fetch_deps: NO, build_dukpt_ui: NO }
- { name: "MacOS 12", os: macos-12, osx_arch: "x86_64", build_type: "Debug", deps: "tr31/qt", fetch_deps: YES, build_dukpt_ui: YES }
- { name: "MacOS 12", os: macos-12, osx_arch: "x86_64", build_type: "Debug", deps: "tr31/qt5", fetch_deps: YES, build_dukpt_ui: YES }
- { name: "MacOS 12", os: macos-12, osx_arch: "x86_64", build_type: "Debug", deps: "tr31/qt6", fetch_deps: YES, build_dukpt_ui: YES }

name: ${{ matrix.name }} (${{ matrix.osx_arch }}) build (static/${{ matrix.build_type }}/${{ matrix.deps }})
runs-on: ${{ matrix.os }}
Expand All @@ -44,11 +46,18 @@ jobs:
- name: Install Qt5 using brew
# Homebrew doesn't support universal binaries so only install Qt for x86_64 builds
if: contains(matrix.deps, 'qt')
if: contains(matrix.deps, 'qt5')
run: |
brew install qt@5
echo "QT_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5" >> $GITHUB_ENV
- name: Install Qt6 using brew
# Homebrew doesn't support universal binaries so only install Qt for x86_64 builds
if: contains(matrix.deps, 'qt6')
run: |
brew install qt@6
echo "QT_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
with:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/windows-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,17 @@ jobs:
echo "CMAKE_REQUIRE_FIND_PACKAGE_MbedTLS=YES" >> $GITHUB_ENV
- name: Install Qt5
if: contains(matrix.deps, 'qt')
# MSYS2 doesn't support Qt6 for i686
if: ${{ contains(matrix.deps, 'qt') && matrix.env == 'i686' }}
run: |
pacman --noconfirm -S --needed mingw-w64-${{matrix.env}}-qt5-base mingw-w64-${{matrix.env}}-qt5-tools
- name: Install Qt6
# MSYS2 doesn't support Qt6 for i686
if: ${{ contains(matrix.deps, 'qt') && matrix.env != 'i686' }}
run: |
pacman --noconfirm -S --needed mingw-w64-${{matrix.env}}-qt6-base mingw-w64-${{matrix.env}}-qt6-tools
- name: Build TR-31 dependency
if: contains(matrix.deps, 'tr31')
run: |
Expand Down Expand Up @@ -100,7 +107,7 @@ jobs:
fail-fast: false
matrix:
include:
- { sys: ucrt64, env: ucrt-x86_64, build_type: "RelWithDebInfo" }
- { sys: mingw64, env: x86_64, build_type: "RelWithDebInfo" }

name: Windows MSYS2 ${{matrix.sys}} build (release)

Expand Down Expand Up @@ -129,14 +136,14 @@ jobs:
mingw-w64-${{matrix.env}}-github-cli
mingw-w64-${{matrix.env}}-nsis
- name: Install Qt
- name: Install Qt6
uses: jurplel/install-qt-action@v3
with:
version: 5.15.*
version: 6.5.*
host: windows
target: desktop
arch: win64_mingw81
archives: qtbase qttools
arch: win64_mingw
archives: qtbase qttools MinGW

- name: Build TR-31 dependency
run: |
Expand All @@ -160,7 +167,7 @@ jobs:
run: cmake -G Ninja -B build -DCMAKE_BUILD_TYPE="${{ matrix.build_type }}" -DBUILD_SHARED_LIBS=YES -DFETCH_MBEDTLS=YES -DFETCH_ARGP=YES -DBUILD_DUKPT_UI=YES -Dtr31_DIR=${{ env.TR31_DIR }}
# CMake will only accept Windows paths if they are environment variables, not CMake command line cache entries
env:
QT_DIR: ${{ env.Qt5_DIR }}
CMAKE_PREFIX_PATH: ${{ env.Qt6_DIR }}

- name: Build
run: cmake --build build
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,10 @@ Qt
This project supports Qt 5.12.x, Qt 5.15.x and Qt 6.5.x (although it may be
possible to use other versions of Qt) when building the `dukpt-ui` application.
However, on some platforms it may be necessary to use the `QT_DIR` option (and
not the `Qt5_DIR` nor `Qt6_DIR` options) to specify the exact Qt installation
to be used. For Qt6 it may also be necessary for the Qt tools to be available
in the executable PATH regardless of the `QT_DIR` option.
not the `Qt5_DIR` nor `Qt6_DIR` options) or `CMAKE_PREFIX_PATH` option to
specify the exact Qt installation to be used. For Qt6 it may also be necessary
for the Qt tools to be available in the executable PATH regardless of the
`QT_DIR` option.

If the Qt installation does not provide universal binaries for MacOS, it will
not be possible to build `dukpt-ui` as a universal binary for MacOS.
Expand Down

0 comments on commit 8267a4b

Please sign in to comment.