From 44473219644bc1ead92b2a0b1f3722c85b1b8bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Fri, 26 Apr 2024 11:13:32 +0800 Subject: [PATCH] action --- .github/workflows/release.yml | 53 ++++++++++++++++++++++++++++++ LunaHost/GUI/Plugin/CMakeLists.txt | 6 ++-- build.py | 21 ++++++++++++ 3 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 build.py diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7fa5a40 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +name: Release + +on: + workflow_dispatch: # allows manual triggering + inputs: + create_release: + description: 'Create new release' + required: true + type: string + +env: + QT_VERSION: 5.15.2 +jobs: + build: + runs-on: windows-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Setup Windows 10 SDK + uses: GuillaumeFalourd/setup-windows10-sdk-action@v2 + with: + sdk-version: 22621 + + + - name: Install Qt + uses: jurplel/install-qt-action@v3.3.0 + with: + version: ${{ env.QT_VERSION }} + host: windows + target: desktop + arch: win64_msvc2019_64 + dir: ${{ runner.temp }} + setup-python: true + - name: Install Qt32 + uses: jurplel/install-qt-action@v3.3.0 + with: + version: ${{ env.QT_VERSION }} + host: windows + target: desktop + arch: win32_msvc2019 + dir: ${{ runner.temp }} + setup-python: true + + - name: Run build script + run: python build.py + - name: Release LunaTranslator + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.event.inputs.create_release }} + files: | + builds/*.zip + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/LunaHost/GUI/Plugin/CMakeLists.txt b/LunaHost/GUI/Plugin/CMakeLists.txt index 6c7fff6..fb984e1 100644 --- a/LunaHost/GUI/Plugin/CMakeLists.txt +++ b/LunaHost/GUI/Plugin/CMakeLists.txt @@ -14,9 +14,9 @@ endif() if(NOT DEFINED WINXP) include(QtUtils.cmake) - msvc_registry_search() - if(Qt5_DIR) + #msvc_registry_search() + #if(Qt5_DIR) find_qt5(Core Widgets WebSockets) add_subdirectory(extensions) - endif() + #endif() endif() \ No newline at end of file diff --git a/build.py b/build.py new file mode 100644 index 0000000..7e128f7 --- /dev/null +++ b/build.py @@ -0,0 +1,21 @@ + +import os +import shutil +import subprocess + +rootDir = os.path.dirname(__file__) + +vcltlFile = "https://github.com/Chuyu-Team/VC-LTL5/releases/download/v5.0.9/VC-LTL-5.0.9-Binary.7z" +vcltlFileName = "VC-LTL-5.0.9-Binary.7z" +def installVCLTL(): + os.makedirs(rootDir + "\\temp",exist_ok=True) + os.chdir(rootDir + "\\temp") + subprocess.run(f"curl -LO {vcltlFile}") + subprocess.run(f"7z x {vcltlFileName} -oVC-LTL5") + os.chdir("VC-LTL5") + subprocess.run("cmd /c Install.cmd") +installVCLTL() +os.chdir(os.path.join(rootDir,'scripts')) +os.system('cmd /c build32.bat') +os.system('cmd /c build64.bat') +os.system('cmd /c pack.bat')