From 96a8a4bbb781e7b9ab94e9721a0f2d2d92d2ca6b Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 21 Aug 2020 02:37:34 -0400 Subject: [PATCH 1/5] Add INSTALL target to CMake. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8d77ce..1ea85ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -82,3 +82,5 @@ add_executable(MoulKI ${all_SOURCES} ) target_link_libraries(MoulKI ${HSPlasmaNet_LIBRARIES} Qt5::Core Qt5::Widgets) + +install(TARGETS MoulKI DESTINATION bin) From 6816945ce4828fee869b66e2eba0761797331639 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 21 Aug 2020 02:06:58 -0400 Subject: [PATCH 2/5] Add Windows CI. --- .github/workflows/windows-ci.yml | 126 +++++++++++++++++++++++++++++++ vcpkg.txt | 5 ++ 2 files changed, 131 insertions(+) create mode 100644 .github/workflows/windows-ci.yml create mode 100644 vcpkg.txt diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml new file mode 100644 index 0000000..0e0c70c --- /dev/null +++ b/.github/workflows/windows-ci.yml @@ -0,0 +1,126 @@ +name: Windows-CI +on: [push, pull_request] + +jobs: + build: + runs-on: windows-latest + + strategy: + matrix: + arch: ["x86", "x64"] + qt: ["5.15.0"] + + env: + CMAKE_GENERATOR: Visual Studio 16 2019 + vcpkg-triplet: ${{ matrix.arch }}-windows-static-md + + steps: + - uses: actions/checkout@v2 + + - name: Bootstrap vcpkg + id: bootstrap-vcpkg + run: | + cd C:\vcpkg + git pull + Write-Host "::set-output name=vcpkg-rev::$(git rev-parse HEAD)" + ./bootstrap-vcpkg.bat + + - name: Restore Dependency Cache + id: cache-vcpkg + uses: actions/cache@v1 + with: + path: C:\vcpkg\installed + key: | + vcpkg-triplet=${{ env.vcpkg-triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }} + restore-keys: | + vcpkg-triplet=${{ env.vcpkg-triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} + vcpkg-triplet=${{ env.vcpkg-triplet }} + + - name: Upgrade Dependencies + if: steps.cache-vcpkg.outputs.cache-hit == 'true' + run: | + vcpkg upgrade --no-dry-run --triplet ${{ env.vcpkg-triplet }} + + - name: Build Dependencies + run: | + vcpkg install `@vcpkg.txt --triplet ${{ env.vcpkg-triplet }} + vcpkg list --x-full-desc + + - name: Configure Platform Arch + run: | + # Qt started providing both x86 and x64 builds for only MSVC 2019 as of 5.15. This was + # true only for MSVC 2017 before then. + [int[]]$qt_ver = "${{ matrix.qt }}".split('.') + if (($qt_ver[0] -eq 5) -and ($qt_ver[1] -lt 15)) { + $qt_compiler = "msvc2017" + } else { + $qt_compiler = "msvc2019" + } + + if ("${{ matrix.arch }}" -eq "x86") { + $cmake_arch = "Win32" + $qt_arch = "win32_$($qt_compiler)" + } else { + $cmake_arch = "${{ matrix.arch }}" + $qt_arch = "win64_$($qt_compiler)_64" + } + Write-Host "::set-env name=CMAKE_GENERATOR_PLATFORM::$cmake_arch" + Write-Host "::set-env name=QT_ARCH::$qt_arch" + + # Qt5 takes roughly a thousand years to build, so we download it from elsehwere... + - name: Restore Qt Cache + id: cache-qt + uses: actions/cache@v1 + with: + path: ${{ github.workspace }}\qt + key: os=${{ runner.os }} qt=${{ matrix.qt }} arch=${{ env.qt_arch }} + + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + arch: ${{ env.QT_ARCH }} + version: ${{ matrix.qt }} + dir: ${{ github.workspace }}\qt + cached: ${{ steps.cache-qt.outputs.cache-hit }} + aqtversion: ==0.9.* + + - name: Checkout HSPlasma + uses: actions/checkout@v2 + with: + repository: H-uru/libhsplasma + path: libhsplasma + + - name: Build libHSPlasma + run: | + cd libhsplasma + mkdir build && cd build + cmake ` + -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ` + -DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} ` + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install ` + -DENABLE_PYTHON=OFF -DENABLE_TOOLS=OFF -DENABLE_NET=ON -DENABLE_PHYSX=OFF .. + cmake --build . --config Release -j 2 + cmake --build . --config Release --target INSTALL + + - name: Build MoulKI + run: | + mkdir build && cd build + cmake ` + -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ` + -DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} ` + -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install ` + .. + cmake --build . --config Release -j 2 + cmake --build . --config Release --target INSTALL + + - name: Deploy Qt + run: | + cd ${{ env.Qt5_Dir }}\bin + $ExeFile = Get-ChildItem "${{ github.workspace }}\install\bin" -Filter *.exe + ./windeployqt.exe --release $ExeFile.FullName + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: ${{ runner.os }}-${{ matrix.arch }}-qt${{ matrix.qt }} + path: install\bin diff --git a/vcpkg.txt b/vcpkg.txt new file mode 100644 index 0000000..9f47d15 --- /dev/null +++ b/vcpkg.txt @@ -0,0 +1,5 @@ +libjpeg-turbo +libpng +openssl +string-theory +zlib From fe86b9f82ca397f3595edfd7a38c5005db108cc1 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 21 Aug 2020 03:17:11 -0400 Subject: [PATCH 3/5] Fix compile errors revealed by CI. --- FetchDialog.cpp | 1 + MoulKI.h | 1 + RefDialog.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/FetchDialog.cpp b/FetchDialog.cpp index 6521a5a..53e77f3 100644 --- a/FetchDialog.cpp +++ b/FetchDialog.cpp @@ -1,4 +1,5 @@ #include "FetchDialog.h" +#include #include "ui_FetchDialog.h" FetchDialog::FetchDialog(QWidget *parent) : diff --git a/MoulKI.h b/MoulKI.h index 8b7343b..46cc08d 100644 --- a/MoulKI.h +++ b/MoulKI.h @@ -1,6 +1,7 @@ #ifndef MOULKI_H #define MOULKI_H +#include #include #include #include "qtAuthClient.h" diff --git a/RefDialog.cpp b/RefDialog.cpp index 9aea1fa..e333615 100644 --- a/RefDialog.cpp +++ b/RefDialog.cpp @@ -1,4 +1,5 @@ #include "RefDialog.h" +#include #include "ui_RefDialog.h" RefDialog::RefDialog(QWidget *parent) : From f83b32eb7f65f9ddd990f16228ef7a626c44666f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 16 Nov 2020 21:16:19 -0500 Subject: [PATCH 4/5] Remove QtGUI from `QIntValidator` include. Co-authored-by: Michael Hansen --- FetchDialog.cpp | 2 +- RefDialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/FetchDialog.cpp b/FetchDialog.cpp index 53e77f3..23cf7b8 100644 --- a/FetchDialog.cpp +++ b/FetchDialog.cpp @@ -1,5 +1,5 @@ #include "FetchDialog.h" -#include +#include #include "ui_FetchDialog.h" FetchDialog::FetchDialog(QWidget *parent) : diff --git a/RefDialog.cpp b/RefDialog.cpp index e333615..0d86e41 100644 --- a/RefDialog.cpp +++ b/RefDialog.cpp @@ -1,5 +1,5 @@ #include "RefDialog.h" -#include +#include #include "ui_RefDialog.h" RefDialog::RefDialog(QWidget *parent) : From 1db8baae8df4fe2ff06224854b8e7c5f9e8c535a Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Thu, 19 Nov 2020 19:20:01 -0500 Subject: [PATCH 5/5] Remove deprecated `::set-env` command usage. --- .github/workflows/windows-ci.yml | 56 ++++++++++---------------------- 1 file changed, 17 insertions(+), 39 deletions(-) diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 0e0c70c..9597c4a 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -3,16 +3,13 @@ on: [push, pull_request] jobs: build: - runs-on: windows-latest + runs-on: ${{ matrix.cfg.os }} strategy: matrix: - arch: ["x86", "x64"] - qt: ["5.15.0"] - - env: - CMAKE_GENERATOR: Visual Studio 16 2019 - vcpkg-triplet: ${{ matrix.arch }}-windows-static-md + cfg: + - { os: windows-2019, generator: Visual Studio 16 2019, cmake-arch: Win32, triplet: x86-windows-static-md, qt: 5.15.0, qt-arch: win32_msvc2019 } + - { os: windows-2019, generator: Visual Studio 16 2019, cmake-arch: x64, triplet: x64-windows-static-md, qt: 5.15.0, qt_arch: win64_msvc2019_64 } steps: - uses: actions/checkout@v2 @@ -31,55 +28,34 @@ jobs: with: path: C:\vcpkg\installed key: | - vcpkg-triplet=${{ env.vcpkg-triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }} + vcpkg-triplet=${{ matrix.cfg.triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} vcpkg-rev=${{ steps.bootstrap-vcpkg.outputs.vcpkg-rev }} restore-keys: | - vcpkg-triplet=${{ env.vcpkg-triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} - vcpkg-triplet=${{ env.vcpkg-triplet }} + vcpkg-triplet=${{ matrix.cfg.triplet }} vcpkg-response=${{ hashFiles('vcpkg.txt') }} + vcpkg-triplet=${{ matrix.cfg.triplet }} - name: Upgrade Dependencies if: steps.cache-vcpkg.outputs.cache-hit == 'true' run: | - vcpkg upgrade --no-dry-run --triplet ${{ env.vcpkg-triplet }} + vcpkg upgrade --no-dry-run --triplet ${{ matrix.cfg.triplet }} - name: Build Dependencies run: | - vcpkg install `@vcpkg.txt --triplet ${{ env.vcpkg-triplet }} + vcpkg install `@vcpkg.txt --triplet ${{ matrix.cfg.triplet }} vcpkg list --x-full-desc - - name: Configure Platform Arch - run: | - # Qt started providing both x86 and x64 builds for only MSVC 2019 as of 5.15. This was - # true only for MSVC 2017 before then. - [int[]]$qt_ver = "${{ matrix.qt }}".split('.') - if (($qt_ver[0] -eq 5) -and ($qt_ver[1] -lt 15)) { - $qt_compiler = "msvc2017" - } else { - $qt_compiler = "msvc2019" - } - - if ("${{ matrix.arch }}" -eq "x86") { - $cmake_arch = "Win32" - $qt_arch = "win32_$($qt_compiler)" - } else { - $cmake_arch = "${{ matrix.arch }}" - $qt_arch = "win64_$($qt_compiler)_64" - } - Write-Host "::set-env name=CMAKE_GENERATOR_PLATFORM::$cmake_arch" - Write-Host "::set-env name=QT_ARCH::$qt_arch" - # Qt5 takes roughly a thousand years to build, so we download it from elsehwere... - name: Restore Qt Cache id: cache-qt uses: actions/cache@v1 with: path: ${{ github.workspace }}\qt - key: os=${{ runner.os }} qt=${{ matrix.qt }} arch=${{ env.qt_arch }} + key: os=${{ runner.os }} qt=${{ matrix.cfg.qt }} arch=${{ matrix.cfg.qt-arch }} - name: Install Qt uses: jurplel/install-qt-action@v2 with: - arch: ${{ env.QT_ARCH }} - version: ${{ matrix.qt }} + arch: ${{ matrix.cfg.qt-arch }} + version: ${{ matrix.cfg.qt }} dir: ${{ github.workspace }}\qt cached: ${{ steps.cache-qt.outputs.cache-hit }} aqtversion: ==0.9.* @@ -95,8 +71,9 @@ jobs: cd libhsplasma mkdir build && cd build cmake ` + -G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" ` -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ` - -DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} ` + -DVCPKG_TARGET_TRIPLET=${{ matrix.cfg.triplet }} ` -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install ` -DENABLE_PYTHON=OFF -DENABLE_TOOLS=OFF -DENABLE_NET=ON -DENABLE_PHYSX=OFF .. cmake --build . --config Release -j 2 @@ -106,8 +83,9 @@ jobs: run: | mkdir build && cd build cmake ` + -G "${{ matrix.cfg.generator }}" -A "${{ matrix.cfg.cmake-arch }}" ` -DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake ` - -DVCPKG_TARGET_TRIPLET=${{ env.vcpkg-triplet }} ` + -DVCPKG_TARGET_TRIPLET=${{ matrix.cfg.triplet }} ` -DCMAKE_INSTALL_PREFIX=${{ github.workspace }}\install ` .. cmake --build . --config Release -j 2 @@ -122,5 +100,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v2 with: - name: ${{ runner.os }}-${{ matrix.arch }}-qt${{ matrix.qt }} + name: ${{ runner.os }}-${{ matrix.cfg.cmake-arch }}-qt${{ matrix.cfg.qt-arch }} path: install\bin