2929 cc : clang
3030 cxx : clang++
3131 platform : macos
32+ - os : windows-latest
33+ arch : x86_64
34+ cc : cl
35+ cxx : cl
36+ platform : windows
3237
3338 runs-on : ${{ matrix.os }}
3439
5156 # Install create-dmg for DMG creation, zstd for compression, and libsodium for encryption
5257 brew install create-dmg zstd libsodium
5358
54- - name : Build Release
59+ - name : Install dependencies (Windows)
60+ if : matrix.platform == 'windows'
61+ run : |
62+ vcpkg install zstd:x64-windows libsodium:x64-windows
63+ echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> $env:GITHUB_ENV
64+
65+ - name : Build Release (non-Windows)
66+ if : matrix.platform != 'windows'
5567 env :
5668 CC : ${{ matrix.cc }}
5769 CXX : ${{ matrix.cxx }}
@@ -66,12 +78,32 @@ jobs:
6678
6779 cmake --build build --config Release -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)
6880
69- - name : Run tests
81+ - name : Build Release (Windows)
82+ if : matrix.platform == 'windows'
83+ run : |
84+ cmake -B build `
85+ -DCMAKE_BUILD_TYPE=Release `
86+ -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" `
87+ -DVCPKG_TARGET_TRIPLET=x64-windows `
88+ -DBFC_WITH_ZSTD=ON `
89+ -DBFC_WITH_SODIUM=ON `
90+ -DBFC_BUILD_BENCHMARKS=OFF
91+ cmake --build build --config Release -j4
92+
93+ - name : Run tests (non-Windows)
94+ if : matrix.platform != 'windows'
7095 run : |
7196 cd build
7297 ctest --output-on-failure
7398
74- - name : Test CLI functionality
99+ - name : Run tests (Windows)
100+ if : matrix.platform == 'windows'
101+ run : |
102+ cd build
103+ ctest --output-on-failure -C Release
104+
105+ - name : Test CLI functionality (non-Windows)
106+ if : matrix.platform != 'windows'
75107 run : |
76108 # Create test data
77109 mkdir -p test_data
@@ -158,11 +190,50 @@ jobs:
158190 rm -rf test.bfc test_data test_compressed.bfc test_fast.bfc test_balanced.bfc
159191 rm -rf test_encrypted.bfc test_keyfile.bfc test_enc_comp.bfc test.key
160192
193+ - name : Test CLI functionality (Windows)
194+ if : matrix.platform == 'windows'
195+ shell : pwsh
196+ run : |
197+ New-Item -ItemType Directory -Force test_data\subdir | Out-Null
198+ "Hello World" | Out-File -Encoding utf8 test_data\hello.txt
199+ "Goodbye" | Out-File -Encoding utf8 test_data\bye.txt
200+ "Nested file" | Out-File -Encoding utf8 test_data\subdir\nested.txt
201+
202+ $bfc = Get-ChildItem -Recurse build\bin -Filter bfc.exe | Select-Object -First 1 -ExpandProperty FullName
203+ if (-not $bfc) { Write-Error "bfc.exe not found"; exit 1 }
204+
205+ & $bfc create test.bfc test_data\
206+ & $bfc list test.bfc
207+ & $bfc info test.bfc
208+ & $bfc verify test.bfc
209+ & $bfc verify --deep test.bfc
210+
211+ & $bfc create -c zstd test_compressed.bfc test_data\
212+ & $bfc verify test_compressed.bfc
213+
214+ New-Item -ItemType Directory -Force extract_test | Out-Null
215+ Push-Location extract_test
216+ & $bfc extract ..\test.bfc
217+ if (Test-Path hello.txt) { Write-Output "hello.txt extracted" }
218+ Pop-Location
219+ Remove-Item -Recurse -Force extract_test
220+
221+ & $bfc create -e testpassword123 test_encrypted.bfc test_data\
222+ New-Item -ItemType Directory -Force extract_enc | Out-Null
223+ Push-Location extract_enc
224+ & $bfc extract -p testpassword123 ..\test_encrypted.bfc
225+ if (Test-Path hello.txt) { Write-Output "hello.txt extracted from encrypted container" }
226+ Pop-Location
227+ Remove-Item -Recurse -Force extract_enc
228+
229+ Remove-Item -Recurse -Force test_data, test.bfc, test_compressed.bfc, test_encrypted.bfc -ErrorAction SilentlyContinue
230+
161231 - name : Get version
162232 id : get_version
163233 run : echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
164234
165- - name : Create release package
235+ - name : Create release package (non-Windows)
236+ if : matrix.platform != 'windows'
166237 run : |
167238 VERSION=${{ steps.get_version.outputs.version }}
168239 PACKAGE_NAME=bfc-${VERSION#v}-${{ matrix.platform }}-${{ matrix.arch }}
@@ -216,6 +287,42 @@ jobs:
216287 # Create tarball
217288 tar -czf ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}
218289
290+ - name : Create release package (Windows)
291+ if : matrix.platform == 'windows'
292+ shell : pwsh
293+ run : |
294+ $version = "${{ steps.get_version.outputs.version }}"
295+ $versionNoV = $version.TrimStart('v')
296+ $pkgName = "bfc-$versionNoV-windows-x86_64"
297+
298+ New-Item -ItemType Directory -Force $pkgName | Out-Null
299+
300+ # Find and copy binaries
301+ $bfcExe = Get-ChildItem -Recurse build\bin -Filter bfc.exe | Select-Object -First 1 -ExpandProperty FullName
302+ Copy-Item $bfcExe "$pkgName\bfc.exe"
303+ Copy-Item (Get-ChildItem -Recurse build\lib -Filter bfc.lib | Select-Object -First 1 -ExpandProperty FullName) "$pkgName\bfc.lib"
304+ Copy-Item (Get-ChildItem -Recurse build\lib -Filter bfc.dll -ErrorAction SilentlyContinue | Select-Object -First 1 -ExpandProperty FullName) "$pkgName\bfc.dll" -ErrorAction SilentlyContinue
305+
306+ # Copy headers and docs
307+ Copy-Item include\bfc.h "$pkgName\"
308+ Copy-Item README.md "$pkgName\"
309+ Copy-Item LICENSE "$pkgName\"
310+
311+ # Create install script
312+ @'
313+ @echo off
314+ echo Installing BFC...
315+ copy bfc.exe "%ProgramFiles%\bfc\bfc.exe" 2>nul || (
316+ mkdir "%ProgramFiles%\bfc"
317+ copy bfc.exe "%ProgramFiles%\bfc\bfc.exe"
318+ )
319+ copy bfc.h "%ProgramFiles%\bfc\bfc.h"
320+ echo BFC installed to %ProgramFiles%\bfc
321+ '@ | Out-File -Encoding ascii "$pkgName\install.bat"
322+
323+ # Create ZIP
324+ Compress-Archive -Path $pkgName -DestinationPath "$pkgName.zip"
325+
219326 - name : Create DEB and RPM packages (Linux only)
220327 if : matrix.platform == 'linux'
221328 run : |
0 commit comments