name: qt-ci on: workflow_dispatch: push: branches: - main tags: - 'qt-**' paths: - ".github/actions/qt5-build/**" - ".github/actions/qt6-build/**" - ".github/workflows/qt-ci.yml" - "bin/**" - "expression-test/**" - "include/**" - "metrics/**" - "platform/default/**" - "platform/qt/**" - "render-test/**" - "scripts/**" - "src/**" - "test/**" - "vendor/**" - ".gitmodules" pull_request: branches: - main paths: - ".github/actions/qt5-build/**" - ".github/actions/qt6-build/**" - ".github/workflows/qt-ci.yml" - "bin/**" - "expression-test/**" - "include/**" - "metrics/**" - "platform/default/**" - "platform/qt/**" - "render-test/**" - "scripts/**" - "src/**" - "test/**" - "vendor/**" - ".gitmodules" concurrency: # cancel jobs on PRs only group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} jobs: build: strategy: matrix: include: - name: Linux os: ubuntu-22.04 build_type: RelWithDebInfo qt_version: 5.15.2 qt_target: desktop - name: Linux os: ubuntu-22.04 build_type: RelWithDebInfo qt_version: 6.4.1 qt_target: desktop - name: macOS os: macos-12 build_type: RelWithDebInfo qt_version: 5.15.2 qt_target: desktop deployment_target: 10.13 deployment_arch: "x86_64" - name: macOS os: macos-12 build_type: RelWithDebInfo qt_version: 6.4.1 qt_target: desktop deployment_target: 10.14 deployment_arch: "x86_64;arm64" - name: win64_msvc2019 os: windows-2022 build_type: "RelWithDebInfo;Debug" compiler_type: x64 compiler_version: 14.29 qt_version: 5.15.2 qt_target: desktop qt_arch: win64_msvc2019_64 qt_tools: '' - name: win64_msvc2019 os: windows-2022 build_type: "RelWithDebInfo;Debug" compiler_type: x64 compiler_version: 14.29 qt_version: 6.4.1 qt_target: desktop qt_arch: win64_msvc2019_64 qt_tools: '' - name: win64_mingw os: windows-2022 build_type: RelWithDebInfo compiler_type: mingw810_64 compiler_version: 8.10.0 qt_version: 5.15.2 qt_target: desktop qt_arch: win64_mingw81 qt_tools: tools_mingw,qt.tools.win64_mingw810 - name: win64_mingw os: windows-2022 build_type: RelWithDebInfo compiler_type: mingw1120_64 compiler_version: 11.2.0 qt_version: 6.4.1 qt_target: desktop qt_arch: win64_mingw qt_tools: tools_mingw90 runs-on: ${{ matrix.os }} env: BUILD_TYPE: ${{ matrix.build_type }} COMPILER_TYPE: ${{ matrix.compiler_type }} DEPLOYMENT_TARGET: ${{ matrix.deployment_target }} DEPLOYMENT_ARCH: ${{ matrix.deployment_arch }} QT_VERSION: ${{ matrix.qt_version }} steps: - name: Checkout uses: actions/checkout@v3 with: path: source fetch-depth: 0 - name: Setup submodules shell: bash run: | cd source auth_header="$(git config --local --get http.https://github.com/.extraheader)" git submodule sync --recursive git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1 || true - name: Download Qt uses: jurplel/install-qt-action@v3 with: aqtversion: ==2.1.* version: ${{ env.QT_VERSION }} dir: ${{ github.workspace }} target: ${{ matrix.qt_target }} arch: ${{ matrix.qt_arch }} tools: ${{ matrix.qt_tools }} - name: Setup ninja uses: seanmiddleditch/gha-setup-ninja@v3 - name: Setup Xcode if: runner.os == 'macOS' uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: Setup MSVC if: matrix.qt_arch == 'win64_msvc2019_64' uses: ilammy/msvc-dev-cmd@v1 with: arch: ${{ matrix.compiler_type }} toolset: ${{ matrix.compiler_version }} - name: Update ccache if: runner.os == 'Windows' shell: bash run: | choco.exe upgrade ccache ccache.exe --version echo "CCACHE_CONFIGPATH=C:/Users/runneradmin/AppData/Roaming/ccache/ccache.conf" >> $GITHUB_ENV - name: Set up ccache uses: hendrikmuhs/ccache-action@v1 with: key: ${{ matrix.name }}_${{ matrix.qt_version }} - name: Build maplibre-gl-native (macOS) if: runner.os == 'macOS' && matrix.qt_target == 'desktop' run: | mkdir build && cd build cmake ../source/ \ -G Ninja \ -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" \ -DCMAKE_INSTALL_PREFIX="../install" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="${DEPLOYMENT_TARGET}" \ -DCMAKE_OSX_ARCHITECTURES="${DEPLOYMENT_ARCH}" \ -DMBGL_WITH_QT=ON \ -DMBGL_QT_DEPLOYMENT=ON \ -DMBGL_QT_LIBRARY_ONLY=ON ninja ninja install - name: Build maplibre-gl-native (Linux, Qt5) if: runner.os == 'Linux' && matrix.qt_version == '5.15.2' uses: ./source/.github/actions/qt5-build - name: Build maplibre-gl-native (Linux, Qt6) if: runner.os == 'Linux' && matrix.qt_version != '5.15.2' uses: ./source/.github/actions/qt6-build - name: Build maplibre-gl-native (Windows) if: runner.os == 'Windows' shell: bash run: | export PATH="$IQTA_TOOLS/$COMPILER_TYPE/bin:$PATH" echo "$PATH" mkdir build && cd build cmake.exe ../source/ \ -G"Ninja Multi-Config" \ -DCMAKE_CONFIGURATION_TYPES="${BUILD_TYPE}" \ -DCMAKE_C_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_CXX_COMPILER_LAUNCHER="ccache.exe" \ -DCMAKE_INSTALL_PREFIX="../install" \ -DMBGL_WITH_QT=ON \ -DMBGL_QT_DEPLOYMENT=ON \ -DMBGL_QT_LIBRARY_ONLY=ON ninja.exe ninja.exe install - name: Create artifacts shell: bash env: QT_ARCH: ${{ matrix.name }} QT_VERSION: ${{ matrix.qt_version }} run: | pushd install tar cjvf ../maplibre-gl-native_${QT_ARCH}_Qt${QT_VERSION}.tar.bz2 * popd - name: Upload artifacts uses: actions/upload-artifact@v3 with: name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }} path: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }}.tar.bz2 test-tarball: needs: build strategy: matrix: include: - name: Linux os: ubuntu-22.04 qt_version: 6.4.1 qt_target: desktop - name: macOS os: macos-12 qt_version: 6.4.1 qt_target: desktop runs-on: ${{ matrix.os }} env: QT_ARCH: ${{ matrix.name }} QT_VERSION: ${{ matrix.qt_version }} steps: - name: Checkout uses: actions/checkout@v3 with: path: source fetch-depth: 0 - name: Download artifacts uses: actions/download-artifact@v3 with: name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }} - name: Download Qt uses: jurplel/install-qt-action@v3 with: aqtversion: ==2.1.* version: ${{ env.QT_VERSION }} dir: ${{ github.workspace }} target: ${{ matrix.qt_target }} - name: Setup Xcode if: runner.os == 'macOS' uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: latest-stable - name: Build test app run: | mkdir install && cd install tar xf ../maplibre-gl-native_${QT_ARCH}_Qt${QT_VERSION}.tar.bz2 cd .. export CMAKE_PREFIX_PATH=$PWD/install mkdir build && cd build cmake ../source/platform/qt/app/ make release: name: Release QMapLibreGL if: github.ref_type == 'tag' runs-on: ubuntu-22.04 needs: test-tarball strategy: max-parallel: 1 matrix: name: [Linux, macOS, win64_msvc2019, win64_mingw] qt_version: [5.15.2, 6.4.1] permissions: contents: write steps: - name: Download artifacts uses: actions/download-artifact@v3 with: name: maplibre-gl-native_${{ matrix.name }}_Qt${{ matrix.qt_version }} - name: Name tarball env: TAG_NAME: ${{ github.ref_name }} TAG_PLATFORM: ${{ matrix.name }} QT_VERSION: ${{ matrix.qt_version }} run: | mv maplibre-gl-native_${TAG_PLATFORM}_Qt${QT_VERSION}.tar.bz2 QMapLibreGL_${TAG_NAME//qt-/}_Qt${QT_VERSION}_${TAG_PLATFORM}.tar.bz2 - name: Release uses: ncipollo/release-action@v1 with: artifacts: QMapLibreGL_*.tar.bz2 allowUpdates: true draft: true