From 224d845af370ac8d40bc085b7bc3d75ea5a05a3b Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Wed, 6 Dec 2023 04:46:10 +0100 Subject: Add gitlab windows build --- .ci/upload-nightly.ps1 | 4 ++++ .ci/windows/build.bat | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 .ci/windows/build.bat (limited to '.ci') diff --git a/.ci/upload-nightly.ps1 b/.ci/upload-nightly.ps1 index 9c1c33c3..9c7da62e 100644 --- a/.ci/upload-nightly.ps1 +++ b/.ci/upload-nightly.ps1 @@ -1,3 +1,6 @@ +# disable progress bar since that requires a pty +$ProgressPreference = "SilentlyContinue" + $file = "nheko_win_64.zip" $fileName = "nheko-${env:APPVEYOR_REPO_BRANCH}-${env:APPVEYOR_REPO_COMMIT}-win64.zip" @@ -19,3 +22,4 @@ $room = "!TshDrgpBNBDmfDeEGN:neko.dev" Invoke-RestMethod -uri "https://matrix.neko.dev/_matrix/client/r0/rooms/${room}/send/m.room.message/${txid}" -Method Put -Body "$body" -ContentType 'application/json' -Headers @{"Authorization"="Bearer ${env:MATRIX_ACCESS_TOKEN}"} +exit 0 diff --git a/.ci/windows/build.bat b/.ci/windows/build.bat new file mode 100644 index 00000000..a79e2360 --- /dev/null +++ b/.ci/windows/build.bat @@ -0,0 +1,50 @@ +:: VERSION format: v1.2.3/v1.3.4 +:: INSTVERSION format: 1.2.3/1.3.4 +:: WINVERSION format: 1.2.3.123/1.3.4.234 +if defined CI_COMMIT_TAG ( + set VERSION=%CI_COMMIT_TAG% +) else ( + set VERSION=v0.11.3 +) +set INSTVERSION=%VERSION:~1% +set WINVERSION=%VERSION:~1%.%CI_JOB_ID% +set DATE=%date:~10,4%-%date:~4,2%-%date:~7,2% +echo %VERSION% +echo %INSTVERSION% +echo %DATE% + + +call "C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/VC/Auxiliary/Build/vcvarsall.bat" x64 +cmake -G "Visual Studio 17 2022" -A x64 -S. -Bbuild -DHUNTER_ROOT="C:\hunter" -DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_KDSINGLEAPPLICATION=ON -DCMAKE_BUILD_TYPE=Release -DHUNTER_CONFIGURATION_TYPES=Release +cmake --build build --config Release + + +git clone https://github.com/Nheko-Reborn/qt-jdenticon.git +cd qt-jdenticon +qmake +nmake +cd .. + +:: create zip bundle +mkdir NhekoRelease +copy build\Release\nheko.exe NhekoRelease\nheko.exe +copy qt-jdenticon\release\qtjdenticon0.dll NhekoRelease\qtjdenticon.dll +copy build\_deps\cmark-build\src\Release\cmark.dll NhekoRelease\cmark.dll +windeployqt --qmldir resources\qml\ NhekoRelease\nheko.exe + +7z a nheko_win_64.zip .\NhekoRelease\* + + +:: create msix +mkdir msix +xcopy .\NhekoRelease\*.* msix\*.* /s /e /c /y +copy .\resources\nheko.png msix +copy .\resources\AppxManifest.xml msix +del msix\vc_redist* +::sed -i "s/ Version=[^ ]*/ Version=\"%WINVERSION%\"/" msix\AppxManifest.xml +@PowerShell "(Get-Content .\msix\AppxManifest.xml)|%%{$_ -creplace ' Version=[^ ]*',' Version=\"%WINVERSION%\"'}|Set-Content .\msix\AppxManifest.xml -Encoding utf8" + +::@PowerShell "Get-Content .\msix\AppxManifest.xml" + +"C:\Program Files (x86)\Windows Kits\10\App Certification Kit\makeappx.exe" pack -d msix -p nheko.msix + -- cgit 1.4.1