Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for qt5, fix build warnings in qt 6.8.0 #714

Merged
merged 2 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ env:

jobs:
deb:
name: deb (${{ matrix.build-type }}, Qt ${{ matrix.qt-version-major }}, ${{ matrix.image }})
name: deb (${{ matrix.build-type }}, Qt 6, ${{ matrix.image }})
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -18,20 +18,12 @@ jobs:
fail-fast: false
matrix:
include:
# Ubuntu's release cycle: https://wiki.ubuntu.com/Releases
- image: ubuntu-20_04
build-script: ubuntu_deb_entrypoint.sh
qt-version-major: 5
build-type: release

- image: ubuntu-22_04
build-script: ubuntu_deb_entrypoint.sh
qt-version-major: 6
build-type: release

- image: ubuntu-23_10
build-script: ubuntu_deb_entrypoint.sh
qt-version-major: 6
build-type: release
steps:
- name: Checkout code
Expand Down Expand Up @@ -75,7 +67,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ steps.build.outputs.deb_name }}-qt${{ matrix.qt-version-major }}-${{ steps.build.outputs.distro_name }}-${{ matrix.build-type }}
name: ${{ steps.build.outputs.deb_name }}-qt6-${{ steps.build.outputs.distro_name }}-${{ matrix.build-type }}
path: ${{ steps.build.outputs.deb_path }}

- name: Login to GitHub Container Registry
Expand Down Expand Up @@ -104,7 +96,7 @@ jobs:
tags: ${{ env.REGISTRY }}/nuttyartist/notes:${{ matrix.image }}

rpm:
name: rpm (${{ matrix.build-type }}, Qt ${{ matrix.qt-version-major }}, ${{ matrix.image }})
name: rpm (${{ matrix.build-type }}, Qt 6, ${{ matrix.image }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -113,13 +105,11 @@ jobs:
# Fedora's release cycle: https://endoflife.date/fedora
- image: fedora-38
build-script: rpm_entrypoint.sh
qt-version-major: 6
build-type: release

# openSUSE's release cycle: https://endoflife.date/opensuse
- image: opensuse-15_5
build-script: rpm_entrypoint.sh
qt-version-major: 6
build-type: release
steps:
- name: Checkout code
Expand Down Expand Up @@ -163,7 +153,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: ${{ steps.build.outputs.rpm_name }}-qt${{ matrix.qt-version-major }}-${{ steps.build.outputs.distro_name }}-${{ matrix.build-type }}
name: ${{ steps.build.outputs.rpm_name }}-qt6-${{ steps.build.outputs.distro_name }}-${{ matrix.build-type }}
path: ${{ steps.build.outputs.rpm_path }}

- name: Login to GitHub Container Registry
Expand Down Expand Up @@ -192,20 +182,14 @@ jobs:
tags: ${{ env.REGISTRY }}/nuttyartist/notes:${{ matrix.image }}

appimage:
name: AppImage (${{ matrix.build-type }}, Qt ${{ matrix.qt-version-major }}, ${{ matrix.image }})
name: AppImage (${{ matrix.build-type }}, Qt 6, ${{ matrix.image }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: appimage-qt5
build-script: appimage_entrypoint.sh
qt-version-major: 5
build-type: release

- image: appimage-qt6
build-script: appimage_entrypoint.sh
qt-version-major: 6
build-type: release
steps:
- name: Checkout code
Expand Down Expand Up @@ -246,7 +230,6 @@ jobs:
run: docker run --rm -v "${GITHUB_OUTPUT}:/GITHUB_OUTPUT" -v "$(pwd):/src" -t '${{ env.REGISTRY }}/nuttyartist/notes:${{ matrix.image }}' -t ${{ matrix.build-type }} ${{ github.ref_type == 'tag' && '-n' || ' ' }}

- name: (FIXME) Run qmllint
if: endsWith(matrix.image, 'qt6')
run: docker run --rm -v "$(pwd):/src" --entrypoint '' -t '${{ env.REGISTRY }}/nuttyartist/notes:${{ matrix.image }}' cmake --build build --target all_qmllint || true

- name: Upload AppImage artifact
Expand Down
56 changes: 8 additions & 48 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,23 @@ jobs:
# So it doesn't make much sense to have different build types other than 'debug' here.
# The release dmg is built using aqtinstall instead (the job below this one).
build-homebrew:
name: Build (${{ matrix.build-type }}, homebrew (qt${{ matrix.qt-version-major }}), ${{ matrix.os }})
name: Build (${{ matrix.build-type }}, homebrew (qt6), ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-13
qt-version-major: 5
build-type: debug

- os: macos-13
qt-version-major: 6
build-type: debug
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Qt ${{ matrix.qt-version-major }} (homebrew)
run: |
brew install ninja qt@${{ matrix.qt-version-major }}

- name: Configure Qt ${{ matrix.qt-version-major }} (homebrew)
if: matrix.qt-version-major == 5
- name: Install Qt 6 (homebrew)
run: |
brew link qt@${{ matrix.qt-version-major }}
cat << EOF
LDFLAGS="-L/usr/local/opt/qt@${{ matrix.qt-version-major }}/lib"
export CPPFLAGS="-I/usr/local/opt/qt@${{ matrix.qt-version-major }}/include"
export PATH="/usr/local/opt/qt@${{ matrix.qt-version-major }}/bin:$PATH"
EOF >> ~/.bashrc
brew install ninja qt@6

- name: Setup CLang problem matcher
# Technically, this action only supports GCC, but it seems to work well for Clang too.
Expand All @@ -55,13 +40,10 @@ jobs:
cmake . --warn-uninitialized --warn-unused-vars \
-G Ninja -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@${{ matrix.qt-version-major }})" \
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@6)" \
-DPRO_VERSION=OFF
cmake --build build

# Build the dmg disk image using the official Qt 5 release downloaded by aqtinstall.
# This is also done for Linux and Windows, just to make sure we use the exact same Qt version across all three OSes.
#
# NOTE: This job uses a fixed Qt version (set in the 'qt-version' key below)!
# So, remember to keep it updated whenever a new Qt version is available on aqtinstall.
dmg-aqtinstall:
Expand All @@ -71,10 +53,6 @@ jobs:
fail-fast: false
matrix:
include:
- os: macos-13
qt-version: 5.15.2
build-type: release

- os: macos-13
qt-version: 6.5.2
build-type: release
Expand All @@ -98,11 +76,7 @@ jobs:
then
version="${version}+g${GITHUB_SHA::7}"
fi
arches='x86_64'
if [[ '${{ matrix.qt-version }}' == 6.* ]]
then
arches+='-arm64'
fi
arches='x86_64-arm64'
artifact_name="Notes_${version}-Qt${{ matrix.qt-version }}-${arches}"
if [ '${{ matrix.build-type }}' == 'debug' ]
then
Expand All @@ -126,23 +100,20 @@ jobs:

- name: Build (${{ matrix.build-type }})
env:
# Only commercial Qt 5 supports targeting Apple Silicon at the moment:
# https://www.qt.io/blog/qt-on-apple-silicon
TARGET_ARCH: ${{ startsWith(matrix.qt-version, '6.') && 'x86_64;arm64' || 'x86_64' }}
TARGET_ARCH: x86_64;arm64
VERBOSE: 1
run: |
export CMAKE_BUILD_PARALLEL_LEVEL=$(sysctl -n hw.logicalcpu)
cmake . --warn-uninitialized --warn-unused-vars \
-B build -G Ninja \
-DCMAKE_OSX_DEPLOYMENT_TARGET=${{ startsWith(matrix.qt-version, '6.') && '11.0' || '10.15' }} \
-DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 \
-DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
-DGIT_REVISION=${{ github.ref_type != 'tag' && 'ON' || 'OFF' }} \
-DCMAKE_OSX_ARCHITECTURES="${{ env.TARGET_ARCH }}" \
-DCMAKE_OSX_ARCHITECTURES='x86_64;arm64' \
-DPRO_VERSION=OFF
cmake --build build

- name: (FIXME) Run qmllint
if: startsWith(matrix.qt-version, '6.')
run: |
cmake --build build --target all_qmllint || true

Expand All @@ -158,17 +129,6 @@ jobs:
mv Notes.app 'Notes Better.app'
macdeployqt 'Notes Better.app' -qmldir=../src/qml -appstore-compliant

- name: Remove unnecessary Qt plugins and libraries
run: |
set -x
set -e
cd 'build/Notes Better.app'
if [[ '${{ matrix.qt-version }}' == 5.* ]]
then
# The bearer plugin has caused problems for us in the past. Plus, it was removed altogether in Qt 6.
rm -rv Contents/PlugIns/bearer
fi

- name: Import signing certificate
if: github.repository == 'nuttyartist/notes' && github.event_name != 'pull_request'
run: |
Expand Down
Loading