diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9d2ab49..10e1b08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,7 +122,9 @@ jobs: "CUDA_TOOLKIT_ROOT_DIR=$env:CUDA_PATH" >> $env:GITHUB_ENV - name: "Run Build-Windows.ps1" - run: "./Build-Windows.ps1" + run: "./Build-Windows.ps1 -Version ${{ steps.get-version.outputs.version }}" + env: + CPU_OR_CUDA: ${{ matrix.cublas }} - uses: "actions/upload-artifact@v4" with: diff --git a/build-windows.ps1 b/build-windows.ps1 index 88a2420..16089c3 100644 --- a/build-windows.ps1 +++ b/build-windows.ps1 @@ -1,3 +1,6 @@ +Param( + [string]$Version +) # check env var CPU_OR_CUDA if ($env:CPU_OR_CUDA -eq $null) { @@ -8,24 +11,22 @@ if ($env:CPU_OR_CUDA -eq $null) { $cmakeArgs = @() if ($env:CPU_OR_CUDA -eq "cpu") { $cmakeArgs += ("-DWHISPERCPP_WITH_CUDA=OFF") + $zipFileName = "whispercpp-windows-cpu-$Version.zip" } else { $cmakeArgs += ( "-DWHISPERCPP_WITH_CUDA=ON", "-DCUDA_TOOLKIT_ROOT_DIR=$env:CUDA_TOOLKIT_ROOT_DIR" ) + $zipFileName = "whispercpp-windows-cuda$env:CPU_OR_CUDA-$Version.zip" } -Remove-Item -Path build/CMakeCache.txt -Force - # configure cmake -S . -B build -DCMAKE_BUILD_TYPE=Release @cmakeArgs cmake --build build --config Release -Remove-Item -Path release -Recurse -Force - # install cmake --install build # compress the release folder -Compress-Archive -Path release -DestinationPath whispercpp-windows-$env:CPU_OR_CUDA.zip +Compress-Archive -Path release -DestinationPath $zipFileName