name: Windows Build on: push: branches: [main] tags: ['v*'] pull_request: branches: [main] jobs: build-windows: name: Windows x64 (MSVC + vcpkg) runs-on: windows-latest env: VCPKG_DEFAULT_TRIPLET: x64-windows VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: - name: Checkout uses: actions/checkout@v4 - name: Export GitHub Actions cache vars uses: actions/github-script@v7 with: script: | core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - name: Setup vcpkg uses: lukka/run-vcpkg@v11 with: vcpkgGitCommitId: '4b77da7fed37817f124936239197833469f1b9a8' - name: Install dependencies via vcpkg run: vcpkg install --triplet x64-windows shell: pwsh - name: Configure CMake run: | cmake -B build -G Ninja ` -DCMAKE_BUILD_TYPE=Release ` -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" ` -DVCPKG_TARGET_TRIPLET=x64-windows ` -DBUILD_GUI=ON ` -DBUILD_TESTS=OFF shell: pwsh - name: Build run: cmake --build build --config Release --parallel shell: pwsh - name: Install run: cmake --install build --prefix dist shell: pwsh - name: Deploy Qt DLLs (windeployqt) run: | $qtBin = Get-ChildItem "$env:VCPKG_ROOT/installed/x64-windows/tools" -Recurse -Filter "windeployqt*.exe" -ErrorAction SilentlyContinue | Select-Object -First 1 if ($qtBin) { & $qtBin.FullName --release --no-translations dist/bin/negative-converter.exe } else { Write-Warning "windeployqt not found, skipping" } shell: pwsh - name: Upload artifact uses: actions/upload-artifact@v4 with: name: negative-converter-windows-x64 path: dist/ if-no-files-found: error - name: Create ZIP for release if: startsWith(github.ref, 'refs/tags/') run: Compress-Archive -Path dist/* -DestinationPath negative-converter-windows-x64.zip shell: pwsh - name: Upload to GitHub Release if: startsWith(github.ref, 'refs/tags/') uses: softprops/action-gh-release@v2 with: files: negative-converter-windows-x64.zip