Release prmers #30
Workflow file for this run
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: Build Windows with OpenCL | |
| on: | |
| workflow_dispatch: | |
| push: | |
| tags: | |
| - 'v*' | |
| permissions: | |
| contents: write | |
| env: | |
| OPENCL_VERSION: 2023.04.17 | |
| jobs: | |
| build-windows: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Install zip utility | |
| run: choco install zip --no-progress | |
| - name: Download OpenCL SDK from Khronos | |
| run: | | |
| curl.exe -o $env:RUNNER_TEMP/opencl.zip -L "https://github.com/KhronosGroup/OpenCL-SDK/releases/download/v${env:OPENCL_VERSION}/OpenCL-SDK-v${env:OPENCL_VERSION}-Win-x64.zip" | |
| mkdir $env:RUNNER_TEMP\opencl | |
| tar.exe -xf $env:RUNNER_TEMP\opencl.zip --strip-components=1 -C $env:RUNNER_TEMP\opencl | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -DCMAKE_BUILD_TYPE=Release ` | |
| -DOpenCL_INCLUDE_DIR="$env:RUNNER_TEMP\opencl\include" ` | |
| -DOpenCL_LIBRARY="$env:RUNNER_TEMP\opencl\lib\OpenCL.lib" | |
| - name: Build | |
| run: cmake --build build --config Release | |
| - name: Package | |
| run: | | |
| mkdir prmers_package | |
| mkdir prmers_package\kernels | |
| copy build\Release\prmers.exe prmers_package\ | |
| copy prmers.cl prmers_package\kernels\ | |
| powershell Compress-Archive -Path prmers_package\* -DestinationPath prmers-windows.zip | |
| - name: Calculate SHA256 checksum | |
| shell: powershell | |
| run: | | |
| $hash = Get-FileHash -Algorithm SHA256 -Path prmers-windows.zip | |
| $hash.Hash | Out-File -Encoding ASCII -NoNewline prmers-windows.zip.sha256 | |
| - name: Read SHA256 for release body | |
| id: read-sha | |
| run: echo "SHA_SUM=$(Get-Content prmers-windows.zip.sha256)" >> $env:GITHUB_ENV | |
| - name: Upload release to GitHub | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| files: | | |
| prmers-windows.zip | |
| prmers-windows.zip.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |