From a5e40cf6aa860b31db4cd52d98f4156a0c330501 Mon Sep 17 00:00:00 2001 From: parhelia512 <0011d3@gmail.com> Date: Mon, 1 Dec 2025 11:09:04 +0800 Subject: [PATCH] ci: build qt with openssl on windows --- .github/workflows/build.yml | 15 +++++++++++---- script/build_qt_static_windows.bat | 2 +- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7287627..20c4ac1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -148,6 +148,12 @@ jobs: with: path: download-artifact # ========================================================================================================= Qt Install + - name: Install OpenSSL (Windows) + if: matrix.platform == 'windows-latest' + shell: bash + run: | + curl -L -o openssl.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/openssl-${{ matrix.target }}.7z + 7z x openssl.7z - name: Qt static Cache id: cache-static-Qt if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12' @@ -156,9 +162,11 @@ jobs: path: qt6/build key: QtStaticCache-${{ matrix.platform }}-${{ matrix.target }}-Qt${{ matrix.qt_version }} - name: Install Qt Windows - shell: powershell + shell: cmd if: matrix.platform == 'windows-latest' && steps.cache-static-Qt.outputs.cache-hit != 'true' && matrix.qt_version != '6.2.12' - run: ./script/build_qt_static_windows.bat ${{ matrix.qt_version }} + run: | + set "OPENSSL_ROOT_DIR=%cd%\openssl" + ./script/build_qt_static_windows.bat ${{ matrix.qt_version }} - name: Install Qt uses: jurplel/install-qt-action@v4.3.0 if: matrix.platform != 'windows-latest' @@ -173,6 +181,7 @@ jobs: if: matrix.platform == 'windows-latest' && matrix.qt_version != '6.2.12' run: | export CMAKE_PREFIX_PATH=$PWD/qt6/build/lib/cmake + export OPENSSL_ROOT_DIR=$PWD/openssl mkdir build cd build curl -fLso srslist.h "https://raw.githubusercontent.com/throneproj/routeprofiles/rule-set/srslist.h" @@ -186,8 +195,6 @@ jobs: run: | curl -L -o qt.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/qt-${{ matrix.target }}.7z 7z x qt.7z - curl -L -o openssl.7z https://github.com/throneproj/env_windows_legacy/releases/download/latest/openssl-${{ matrix.target }}.7z - 7z x openssl.7z export CMAKE_PREFIX_PATH=$PWD/Qt/lib/cmake export OPENSSL_ROOT_DIR=$PWD/openssl mkdir build diff --git a/script/build_qt_static_windows.bat b/script/build_qt_static_windows.bat index da31317..ac8c416 100644 --- a/script/build_qt_static_windows.bat +++ b/script/build_qt_static_windows.bat @@ -3,7 +3,7 @@ cd qt6 git switch %1 mkdir build -CALL .\configure.bat -release -static -prefix ./build -static-runtime -submodules qtbase,qtimageformats,qtsvg,qttranslations -skip tests -skip examples -gui -widgets -init-submodules +CALL .\configure.bat -release -static -prefix ./build -static-runtime -submodules qtbase,qtimageformats,qtsvg,qttranslations -skip tests -skip examples -gui -widgets -init-submodules -no-schannel -openssl-linked -no-dtls -no-ocsp echo on branch %1 echo config complete, building... cmake --build . --parallel