Skip to content

Faster Stage 2 P-1 factoring #486

Faster Stage 2 P-1 factoring

Faster Stage 2 P-1 factoring #486

Workflow file for this run

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
continue-on-error: true
- name: Download OpenCL SDK
run: |
curl.exe -L -o $env:RUNNER_TEMP/opencl.zip "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: Clone and bootstrap vcpkg
run: |
git clone https://github.com/microsoft/vcpkg.git
.\vcpkg\bootstrap-vcpkg.bat
- name: Cache vcpkg packages
uses: actions/cache@v3
with:
path: |
vcpkg/installed
vcpkg/buildtrees
vcpkg/downloads
key: ${{ runner.os }}-vcpkg
- name: Install dependencies via vcpkg
run: .\vcpkg\vcpkg install curl:x64-windows gmp:x64-windows pkgconf:x64-windows
- name: Add pkgconf to PATH
shell: powershell
run: |
echo "${{ github.workspace }}\vcpkg\installed\x64-windows\tools\pkgconf" `
| Out-File -FilePath $Env:GITHUB_PATH -Encoding utf8 -Append
- name: Configure CMake
shell: powershell
run: |
$toolchain = "${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake"
cmake -S . -B build `
-DCMAKE_TOOLCHAIN_FILE="$toolchain" `
-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: Generate code signing certificate
shell: powershell
run: |
$cert = New-SelfSignedCertificate -Type CodeSigningCert `
-Subject "CN=DevCert Prmers" `
-CertStoreLocation Cert:\CurrentUser\My
$pwd = ConvertTo-SecureString -String "prmers123" `
-Force -AsPlainText
Export-PfxCertificate -Cert $cert `
-FilePath prmerscert.pfx -Password $pwd
- name: Find signtool.exe
id: signtool
shell: powershell
run: |
$sig = Get-ChildItem "C:\Program Files (x86)\Windows Kits\10\bin" `
-Recurse -Filter signtool.exe |
Where-Object { $_.FullName -match 'x64\\signtool.exe$' } |
Sort-Object LastWriteTime -Descending |
Select-Object -First 1
if ($sig) {
echo "SIGNSRC=$($sig.FullName)" >> $env:GITHUB_ENV
} else { exit 1 }
- name: Skip signing
shell: powershell
run: |
echo "Skipping signing for now"
- name: Package
shell: powershell
run: |
mkdir prmers_package; mkdir prmers_package\kernels
Copy-Item build\Release\prmers.exe prmers_package\
Copy-Item kernels\prmers.cl prmers_package\kernels\
Copy-Item vcpkg\installed\x64-windows\bin\*.dll prmers_package\
Compress-Archive -Path prmers_package\* `
-DestinationPath prmers-windows.zip
- name: Calculate SHA256 checksum
shell: powershell
run: |
$h = Get-FileHash -Algorithm SHA256 -Path prmers-windows.zip
$h.Hash | Out-File -Encoding ASCII -NoNewline prmers-windows.zip.sha256
- name: Upload release to GitHub
uses: softprops/action-gh-release@v2
with:
files: |
prmers-windows.zip
prmers-windows.zip.sha256
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}