Update Windows.yml #758
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: OpenHD Image Writer Windows | |
| on: | |
| push: | |
| branches: | |
| - "2.5-evo" | |
| - "dev-release" | |
| - "release" | |
| - "testing" | |
| paths-ignore: | |
| - '**.md' | |
| - '**.asciidoc' | |
| - '**.adoc' | |
| - '.gitignore' | |
| - 'LICENSE' | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| working-directory: src | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - name: Install Qt | |
| id: qt-install | |
| uses: jurplel/install-qt-action@v4 | |
| with: | |
| version: '5.15.2' | |
| host: windows | |
| target: desktop | |
| arch: win32_mingw81 | |
| dir: '${{ runner.workspace }}' | |
| archives: 'qtbase qtdeclarative qttools qtsvg qtwinextras qtquickcontrols' | |
| tools: 'tools_cmake tools_mingw81,qt.tools.win32_mingw810' | |
| setup-python: 'true' | |
| - name: Download and Extract OpenSSL | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| Invoke-WebRequest ` | |
| -Uri "https://download.firedaemon.com/FireDaemon-OpenSSL/openssl-1.1.1w.zip" ` | |
| -OutFile openssl-1.1.1w.zip | |
| Expand-Archive openssl-1.1.1w.zip -DestinationPath openssl111 | |
| - name: Copy OpenSSL to Qt MinGW path | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| dir ${{ github.workspace }}\..\Qt\ | |
| dir ${{ github.workspace }}\..\Qt\Tools\ | |
| dir ${{ github.workspace }}\..\Qt\Tools\mingw810_32\ | |
| $openssl = (Get-ChildItem -Directory -Path "${{ github.workspace }}\openssl111" | Where-Object { $_.Name -like "openssl-*" } | Select-Object -First 1).FullName + "\x86" | |
| $mingwRoot = "${{ github.workspace }}\..\Qt\Tools\mingw810_32" | |
| Write-Host "Resolved OpenSSL path: $openssl" | |
| if (Test-Path $openssl) { | |
| Get-ChildItem -Recurse "$openssl" | ForEach-Object { Write-Host $_.FullName } | |
| } else { | |
| Write-Error "OpenSSL path not found: $openssl" | |
| } | |
| Copy-Item "$openssl\bin\libcrypto-1_1.dll" "$mingwRoot\bin\" -Force | |
| Copy-Item "$openssl\bin\libssl-1_1.dll" "$mingwRoot\bin\" -Force | |
| Copy-Item "$openssl\lib\libcrypto.lib" "$mingwRoot\lib\" -Force | |
| Copy-Item "$openssl\lib\libssl.lib" "$mingwRoot\lib\" -Force | |
| New-Item -ItemType Directory -Force -Path "$mingwRoot\include\openssl" | |
| Write-Host "Copying OpenSSL headers from: $openssl\include\openssl\." | |
| Copy-Item "$openssl\include\openssl\." "$mingwRoot\include\" -Recurse -Force -Verbose | |
| dir "$mingwRoot\include\openssl\" | |
| - name: Install NSIS | |
| run: choco install nsis --x86 --force -y | |
| - name: Show Qt & CMake Info | |
| run: | | |
| where gcc | |
| where g++ | |
| cmake --version | |
| - name: Debug OpenSSL include headers | |
| shell: pwsh | |
| working-directory: ${{ github.workspace }} | |
| run: | | |
| $opensslInclude = "$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\include\openssl" | |
| $openssl = (Get-ChildItem -Directory -Path "${{ github.workspace }}\openssl111" | Where-Object { $_.Name -like "openssl-*" } | Select-Object -First 1).FullName + "\x86" | |
| Write-Host "Looking in: $opensslInclude" | |
| if (Test-Path $opensslInclude) { | |
| Get-ChildItem $opensslInclude | Select-Object -First 20 | |
| } else { | |
| Write-Error "OpenSSL include directory not found!" | |
| } | |
| dir "$openssl\include\openssl\" | |
| - name: Configure CMake | |
| shell: cmd | |
| working-directory: src | |
| run: | | |
| dir "%GITHUB_WORKSPACE%\openssl111\openssl-1.1\x86\include" | |
| mkdir build | |
| cd build | |
| cmake .. -G "MinGW Makefiles" ^ | |
| -DCMAKE_BUILD_TYPE=Release ^ | |
| -DCMAKE_C_COMPILER="%GITHUB_WORKSPACE%\..\Qt\Tools\mingw810_32\bin\gcc.exe" ^ | |
| -DCMAKE_CXX_COMPILER="%GITHUB_WORKSPACE%\..\Qt\Tools\mingw810_32\bin\g++.exe" ^ | |
| -DOPENSSL_INCLUDE_DIR="%GITHUB_WORKSPACE%\openssl111\openssl-1.1\x86\include" ^ | |
| -DOPENSSL_LIBRARIES="%GITHUB_WORKSPACE%\openssl111\openssl-1.1\x86\lib" | |
| - name: Check CMake Cache | |
| run: | | |
| dir build | |
| type build\CMakeCache.txt || echo "Cache missing" | |
| - name: Build | |
| shell: pwsh | |
| run: | | |
| $env:PATH = "$Env:GITHUB_WORKSPACE\..\Qt\5.15.2\mingw81_32\bin;$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\bin;$env:PATH" | |
| cd build | |
| cmake --build . --verbose | |
| - name: Copy OpenSSL DLLs to build folder | |
| shell: pwsh | |
| run: | | |
| Copy-Item "$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\bin\libssl-1_1.dll" -Destination "$Env:GITHUB_WORKSPACE\src\build\" | |
| Copy-Item "$Env:GITHUB_WORKSPACE\..\Qt\Tools\mingw810_32\bin\libcrypto-1_1.dll" -Destination "$Env:GITHUB_WORKSPACE\src\build\" | |
| - name: Build NSIS Installer | |
| shell: pwsh | |
| working-directory: src\build | |
| run: | | |
| & "${Env:ProgramFiles(x86)}\NSIS\makensis.exe" "openhdimagewriter.nsi" | |
| - name: Upload Installer | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: OpenHDImageWriter-Build-Full | |
| path: src/build/OpenHD-ImageWriter-* | |
| if-no-files-found: error |