From efdc2c0ca8da03a99a47c61810fc01e11b81ac12 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 16 Dec 2021 05:31:14 +0100 Subject: [PATCH] Windows CI for meson --- .ci/windows/build-meson.cmd | 17 +++++++++++ .ci/windows/deploy-meson.cmd | 58 ++++++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 16 ++++++++++ 3 files changed, 91 insertions(+) create mode 100755 .ci/windows/build-meson.cmd create mode 100755 .ci/windows/deploy-meson.cmd diff --git a/.ci/windows/build-meson.cmd b/.ci/windows/build-meson.cmd new file mode 100755 index 00000000..c0465aff --- /dev/null +++ b/.ci/windows/build-meson.cmd @@ -0,0 +1,17 @@ +set QT_DIR=C:\Qt\5.15.2\msvc2019_64 +set Qt5_DIR=%QT_DIR%\lib\cmake\Qt5 +set PATH=%PATH:C:\cygwin64\bin;=% +set PATH=C:\ProgramData\chocolatey\bin;C:\Python310;%QT_DIR%\bin;%PATH% +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64 + +REM Build nheko +meson setup builddir +meson compile -C builddir + +REM build qt-jdenticon +git clone https://github.com/Nheko-Reborn/qt-jdenticon.git +cd qt-jdenticon +qmake +nmake +cd .. + diff --git a/.ci/windows/deploy-meson.cmd b/.ci/windows/deploy-meson.cmd new file mode 100755 index 00000000..c12bfda1 --- /dev/null +++ b/.ci/windows/deploy-meson.cmd @@ -0,0 +1,58 @@ +set QT_DIR="C:\Qt\5.15.2\msvc2019_64" +set Qt5_DIR="%QT_DIR%\lib\cmake\Qt5" +set PATH=%PATH:C:\cygwin64\bin;=% +set PATH=C:\Python310;%QT_DIR%\bin;%PATH% +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64 + +@REM set BUILD=%CI_BUILDS_DIR% +echo %BUILD% +mkdir NhekoRelease +copy builddir\Release\nheko.exe NhekoRelease\nheko.exe +copy qt-jdenticon\release\qtjdenticon0.dll NhekoRelease\qtjdenticon.dll +windeployqt --qmldir resources\qml\ NhekoRelease\nheko.exe + +7z a nheko_win_64.zip .\NhekoRelease\* +ls -lh build\Release\ +ls -lh NhekoRelease\ +mkdir NhekoData +xcopy .\NhekoRelease\*.* NhekoData\*.* /s /e /c /y + +REM Create the Qt Installer Framework version + +mkdir installer +mkdir installer\config +mkdir installer\packages +mkdir installer\packages\io.github.nhekoreborn.nheko +mkdir installer\packages\io.github.nhekoreborn.nheko\data +mkdir installer\packages\io.github.nhekoreborn.nheko\meta + +REM Copy installer data +copy %BUILD%\resources\nheko.ico installer\config +copy %BUILD%\resources\nheko.png installer\config +copy %BUILD%\COPYING installer\packages\io.github.nhekoreborn.nheko\meta\license.txt +copy %BUILD%\deploy\installer\config.xml installer\config +copy %BUILD%\deploy\installer\controlscript.qs installer\config +copy %BUILD%\deploy\installer\uninstall.qs installer\packages\io.github.nhekoreborn.nheko\data +copy %BUILD%\deploy\installer\gui\package.xml installer\packages\io.github.nhekoreborn.nheko\meta +copy %BUILD%\deploy\installer\gui\installscript.qs installer\packages\io.github.nhekoreborn.nheko\meta + +REM Amend version and date +sed -i "s/__VERSION__/0.9.0/" installer\config\config.xml +sed -i "s/__VERSION__/0.9.0/" installer\packages\io.github.nhekoreborn.nheko\meta\package.xml +sed -i "s/__DATE__/%DATE%/" installer\packages\io.github.nhekoreborn.nheko\meta\package.xml + +REM Copy nheko data +xcopy NhekoData\*.* installer\packages\io.github.nhekoreborn.nheko\data\*.* /s /e /c /y +move NhekoRelease\nheko.exe installer\packages\io.github.nhekoreborn.nheko\data +mkdir tools + +REM curl -L -O https://download.qt.io/official_releases/qt-installer-framework/3.0.4/QtInstallerFramework-win-x86.exe +REM Since the official download.qt.io is down atm +curl -L -O https://qt-mirror.dannhauer.de/official_releases/qt-installer-framework/4.0.1/QtInstallerFramework-win-x86.exe +7z x QtInstallerFramework-win-x86.exe -otools -aoa +set PATH=%BUILD%\tools\bin;%PATH% +binarycreator.exe -f -c installer\config\config.xml -p installer\packages nheko-installer.exe + +copy nheko-installer.exe nheko-%APPVEYOR_REPO_TAG_NAME%-installer.exe +copy nheko-installer.exe nheko-%APPVEYOR_PULL_REQUEST_HEAD_COMMIT%-installer.exe + diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index eec526f9..d0cd784c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -204,6 +204,22 @@ build-flatpak-arm64: paths: ['build-flatpak/nheko-arm64.flatpak'] name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-arm64 +build-windows-meson: + stage: build + image: win10-base + tags: [windows] + variables: + BUILD: ${CI_BUILDS_DIR} + script: + - PATH=${PATH##/usr/local/bin:/usr/bin:/bin:} ./.ci/windows/build-meson.cmd + - ls -la + after_script: + - PATH=${PATH##/usr/local/bin:/usr/bin:/bin:} ./.ci/windows/deploy-meson.cmd + cache: + key: "$CI_JOB_NAME" + paths: + - subprojects + linting: stage: build image: alpine:latest