From 7c6a438c53ea24f95b5f2d901c812f5becb2fc8c Mon Sep 17 00:00:00 2001 From: Allan Chain <36528777+AllanChain@users.noreply.github.com> Date: Sat, 13 Jul 2024 19:47:04 +0800 Subject: [PATCH] use static qt build --- .github/workflows/build.yml | 43 ++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c243eb1..f6bd70a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,9 +3,6 @@ name: Build -env: - CL: /MP # Multi-threaded compilation for MSVC - on: [workflow_dispatch, push] jobs: @@ -16,25 +13,27 @@ jobs: os: [windows-latest, macos-latest] include: - os: windows-latest - os-caption: Windows + os-caption: windows - os: macos-latest - os-caption: MacOS + os-caption: macos runs-on: ${{matrix.os}} steps: - - name: Clone Project - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - name: Install Qt - uses: jurplel/install-qt-action@v4 - with: - version: 6.7.2 + run: | + cd .. + curl -LO https://github.com/AllanChain/static-qt6/releases/download/v6.7.2-2/qt-6.7.2-static-${{matrix.os-caption}}.zip + 7z x qt-6.7.2-static-${{matrix.os-caption}}.zip - name: Configure MSVC (Windows) if: contains(matrix.os, 'windows') uses: ilammy/msvc-dev-cmd@v1 - name: Make Project + env: + CMAKE_TOOLCHAIN_FILE: ../../qt6_static_64/lib/cmake/Qt6/qt.toolchain.cmake run: | mkdir build cd build @@ -42,34 +41,30 @@ jobs: - name: Build Project (Windows) if: contains(matrix.os, 'windows') - run: | - cd build - msbuild sane-break.sln /property:Configuration=Release -maxcpucount + working-directory: build + env: + CL: /MP # Build with multiple processes + run: msbuild sane-break.sln /property:Configuration=Release -maxcpucount - name: Build Project (macOS) if: contains(matrix.os, 'macos') - run: | - cd build - make -j3 + working-directory: build + run: make -j3 - name: Packing (Windows) if: contains(matrix.os, 'windows') run: | - cd build - windeployqt --release --no-compiler-runtime --no-opengl-sw release - move release ..\ + mkdir release + move sane-break.exe release - name: Packing (macOs) if: contains(matrix.os, 'macos') run: | mkdir release - cp -rf build/sane-break.app release/ - cd release - macdeployqt sane-break.app -dmg - rm -rf sane-break.app + hdiutil create -volname "Sane Break" -srcfolder build/sane-break.app -ov release/sane-break.dmg - name: Create Artifact uses: actions/upload-artifact@v4 with: name: "sane-break (${{matrix.os-caption}})" - path: ./release/ + path: ./release/*