diff --git a/.github/workflows/qt-msvc-build.yml b/.github/workflows/qt-msvc-build.yml index 881b66e..342bab2 100644 --- a/.github/workflows/qt-msvc-build.yml +++ b/.github/workflows/qt-msvc-build.yml @@ -16,19 +16,72 @@ jobs: - name: Setup MSVC uses: microsoft/setup-msbuild@v1 with: - vs-version: 'latest' # Use the latest Visual Studio version + vs-version: 'latest' + + - name: Set up Visual Studio shell + uses: egor-tensin/vs-shell@v2 + with: + arch: x64 - name: Install Qt - run: | - choco install qt --version=latest --params '/QtAddToPath' - # Ensure the PATH is updated - echo "##vso[task.setvariable variable=PATH]$($env:PATH);C:\Qt\$(Get-Item C:\Qt\*\msvc*\bin).Name" + uses: jurplel/install-qt-action@v4 + with: + version: '6.7.2' + add-tools-to-path: true + tools: 'tools_qtcreator,qt.tools.qtcreator' - - name: Build with qmake + - name: Build with qmake and jom + shell: pwsh run: | mkdir build cd build - qmake ..\yourproject.pro - nmake + qmake ..\BigPictureTV-CPP.pro + D:\a\BigPictureTV\Qt\Tools\QtCreator\bin\jom\jom.exe + + + - name: Search for windeployqt executables + shell: pwsh + run: | + # Define the Qt root directory from the environment variable + $qtRootDir = $env:QT_ROOT_DIR + + # Search for windeployqt6.exe and windeployqt.exe within the Qt directory + $searchResults = Get-ChildItem -Path $qtRootDir -Recurse -Filter "windeployqt*.exe" -ErrorAction SilentlyContinue + + # Check if the files were found and print their paths + if ($searchResults) { + foreach ($file in $searchResults) { + Write-Output "Found $($file.Name) at: $($file.FullName)" + } + } else { + Write-Output "No windeployqt executable found in $qtRootDir" + } + + - name: Run windeployqt + shell: pwsh + run: | + # Navigate to the directory containing the executable + cd build - # Optionally, you can add steps for packaging or deploying the application + # Use the found path to windeployqt + $windeployqtPath = "D:\a\BigPictureTV\Qt\6.7.2\msvc2019_64\bin\windeployqt6.exe" + + # Check if the executable exists + if (Test-Path $windeployqtPath) { + # Run windeployqt to deploy the executable with the specified options + & $windeployqtPath ` + --no-translations ` + --no-opengl-sw ` + --no-system-d3d-compiler ` + --no-compiler-runtime ` + BigPictureTV-CPP.exe + } else { + Write-Error "windeployqt not found at the expected path!" + exit 1 + } + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: qt-build-artifacts + path: build/ \ No newline at end of file