From 446b5cc4db82d5e083006a51d4f9a8b0f094adc3 Mon Sep 17 00:00:00 2001 From: Christoph Settgast Date: Thu, 10 Aug 2023 22:11:35 +0200 Subject: [PATCH 1/6] qt6: Build with mingw as well in CI to avoid accidentally breaking mingw build We dont ship the mingw build, but we want to make sure that it continues to build and not accidentally break it. --- .github/workflows/ci.yml | 85 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 82 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d33470cd0916..1bef6256baab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -181,8 +181,8 @@ jobs: path: out/Seamly2D-macos.zip if-no-files-found: error - windows: - name: 'Windows: Build' + windows-msvc: + name: 'Windows: Build with msvc' runs-on: windows-latest needs: version env: @@ -254,10 +254,89 @@ jobs: path: Seamly2D-windows.zip if-no-files-found: error + windows-mingw: + name: 'Windows: Build with mingw' + runs-on: windows-latest + needs: version + env: + VERSION_NUMBER: ${{ needs.version.outputs.version_number }} + + steps: + - uses: actions/checkout@v3 + + - name: Remove preinstalled mingw + # we use the same mingw from Qt tools instead of the github actions hosted runner one, so that its as close as possible to developer setup + # in addition, the code was not compiling with the provided one and just failing with a nondescript "error 1" + shell: bash + run: | + choco uninstall mingw -y + + - uses: jurplel/install-qt-action@v3 + with: + version: ${{ env.QT_VERSION }} + cache: true + arch: win64_mingw + modules: qt5compat qtmultimedia + tools: tools_mingw90 + + - name: update version + shell: bash + run: | + ./scripts/version.sh ${VERSION_NUMBER} + + - name: make seamly2d.exe and seamlyme.exe + shell: bash + # we use the same mingw from Qt tools so that its as close as possible to developer setup + run: | + export "PATH=/d/a/Seamly2D/Qt/Tools/mingw1120_64/bin:$PATH" + qmake.exe Seamly2D.pro -config release CONFIG+=noTests + mingw32-make + + - name: create seamly2d-installer.exe + # copy seamly2d and seamlyme directory trees prepared by windeployqt and create installer + # uses parameters in seamly2d-installer.nsi to create the installer exe + run: | + mkdir ..\windows-build + Copy-Item -Path 'src\app\seamly2d\bin\*' -Destination ..\windows-build -Recurse + Copy-Item -Path 'src\app\seamlyme\bin\*' -Destination ..\windows-build -Recurse -Force + Copy-Item -Path dist\seamly2d-installer.nsi -Destination ..\windows-build + cd ..\windows-build\ + & 'C:\Program Files (x86)\NSIS\makensis.exe' seamly2d-installer.nsi + + - name: setup signing + id: setup_signing + uses: timheuer/base64-to-file@v1.2 + env: + PFX_BASE64: ${{ secrets.pfx_base64 }} + if: ${{ env.PFX_BASE64 }} + with: + encodedString: ${{ secrets.pfx_base64 }} + fileName: seamly2d.pfx + + - name: sign installer + env: + PFX_BASE64: ${{ secrets.pfx_base64 }} + if: ${{ env.PFX_BASE64 }} + run: | + cd ..\windows-build\ + SignTool sign /fd SHA256 /f ${{ steps.setup_signing.outputs.filePath }} /p ${{ secrets.pfx_password }} /t http://timestamp.sectigo.com Seamly2D-installer.exe + + - name: pack installer file into .zip + run: | + cd ..\windows-build\ + C:\"Program Files"\7-Zip\7z.exe a Seamly2D-windows-mingw.zip Seamly2D-installer.exe + copy Seamly2D-windows-mingw.zip ..\Seamly2D\ + + - uses: actions/upload-artifact@v3 + with: + name: Seamly2D-windows-mingw.zip + path: Seamly2D-windows-mingw.zip + if-no-files-found: error + publish: if: false runs-on: ubuntu-latest - needs: [version, windows, linux, macos] + needs: [version, windows-msvc, linux, macos] env: VERSION_NUMBER: ${{ needs.version.outputs.version_number }} From fb5732b8ee5d0fb60340686ecb9da05bf7bddc56 Mon Sep 17 00:00:00 2001 From: Christoph Settgast Date: Thu, 17 Aug 2023 21:56:30 +0200 Subject: [PATCH 2/6] fix: add missing Json header includes detected when building with mingw --- src/app/seamly2d/core/vapplication.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/seamly2d/core/vapplication.cpp b/src/app/seamly2d/core/vapplication.cpp index 1511de5027bd..64aa01f44adb 100644 --- a/src/app/seamly2d/core/vapplication.cpp +++ b/src/app/seamly2d/core/vapplication.cpp @@ -75,6 +75,8 @@ #include #include #include +#include +#include QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") From 155b46637c5ef92e33943e4abf1491795434a5e1 Mon Sep 17 00:00:00 2001 From: Christoph Settgast Date: Thu, 17 Aug 2023 21:57:41 +0200 Subject: [PATCH 3/6] ci: use parallel build for mingw --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a2224d93c5b0..6efda048da17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -284,7 +284,7 @@ jobs: run: | export "PATH=/d/a/Seamly2D/Qt/Tools/mingw1120_64/bin:$PATH" qmake.exe Seamly2D.pro -config release CONFIG+=noTests - mingw32-make + mingw32-make -j - name: create seamly2d-installer.exe # copy seamly2d and seamlyme directory trees prepared by windeployqt and create installer From a199aceb086231d0cd06d752ec6791a251d09020 Mon Sep 17 00:00:00 2001 From: Christoph Settgast Date: Thu, 17 Aug 2023 22:19:13 +0200 Subject: [PATCH 4/6] fix: add missing QJsonDocument header --- src/app/seamly2d/core/vapplication.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/seamly2d/core/vapplication.cpp b/src/app/seamly2d/core/vapplication.cpp index 64aa01f44adb..302531a36043 100644 --- a/src/app/seamly2d/core/vapplication.cpp +++ b/src/app/seamly2d/core/vapplication.cpp @@ -77,6 +77,7 @@ #include #include #include +#include QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wmissing-prototypes") From fe034ac87b1a9e3e98e9b14d4029bd6b65c96aea Mon Sep 17 00:00:00 2001 From: Christoph Settgast Date: Thu, 17 Aug 2023 22:51:33 +0200 Subject: [PATCH 5/6] ci: reduce parallelism for mingw otherwise compilation fails with oom --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6efda048da17..8f4200ef55bb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -284,7 +284,7 @@ jobs: run: | export "PATH=/d/a/Seamly2D/Qt/Tools/mingw1120_64/bin:$PATH" qmake.exe Seamly2D.pro -config release CONFIG+=noTests - mingw32-make -j + mingw32-make -j2 - name: create seamly2d-installer.exe # copy seamly2d and seamlyme directory trees prepared by windeployqt and create installer From bd9c1a0d890edbb76e77b56847c8a1d4be42f3af Mon Sep 17 00:00:00 2001 From: Christoph Settgast Date: Thu, 17 Aug 2023 23:16:56 +0200 Subject: [PATCH 6/6] ci: dont sign mingw we dont release the mingw builds, so no need to sign them --- .github/workflows/ci.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f4200ef55bb..ae83e580c6e7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -297,24 +297,6 @@ jobs: cd ..\windows-build\ & 'C:\Program Files (x86)\NSIS\makensis.exe' seamly2d-installer.nsi - - name: setup signing - id: setup_signing - uses: timheuer/base64-to-file@v1.2 - env: - PFX_BASE64: ${{ secrets.pfx_base64 }} - if: ${{ env.PFX_BASE64 }} - with: - encodedString: ${{ secrets.pfx_base64 }} - fileName: seamly2d.pfx - - - name: sign installer - env: - PFX_BASE64: ${{ secrets.pfx_base64 }} - if: ${{ env.PFX_BASE64 }} - run: | - cd ..\windows-build\ - SignTool sign /fd SHA256 /f ${{ steps.setup_signing.outputs.filePath }} /p ${{ secrets.pfx_password }} /t http://timestamp.sectigo.com Seamly2D-installer.exe - - name: pack installer file into .zip run: | cd ..\windows-build\