|
| 1 | +name: Koboldcpp Windows OlderPC Nocuda |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + commit_hash: |
| 7 | + description: 'Optional commit hash to build from' |
| 8 | + required: false |
| 9 | + default: '' |
| 10 | + |
| 11 | +env: |
| 12 | + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |
| 13 | + |
| 14 | +jobs: |
| 15 | + windows: |
| 16 | + runs-on: windows-2022 |
| 17 | + steps: |
| 18 | + - name: Clone |
| 19 | + id: checkout |
| 20 | + uses: actions/checkout@v3 |
| 21 | + with: |
| 22 | + ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }} |
| 23 | + |
| 24 | + - name: Show Commit Used |
| 25 | + run: | |
| 26 | + echo "Building from ref: ${{ inputs.commit_hash != '' && inputs.commit_hash || github.head_ref || github.ref_name }}" |
| 27 | +
|
| 28 | + - name: Get Python |
| 29 | + uses: actions/setup-python@v2 |
| 30 | + with: |
| 31 | + python-version: 3.8.10 |
| 32 | + |
| 33 | + - name: Install python dependencies |
| 34 | + run: | |
| 35 | + python -m pip install --upgrade pip |
| 36 | + pip install customtkinter==5.2.0 pyinstaller==5.12.0 psutil==5.9.5 |
| 37 | +
|
| 38 | + - name: Display full Visual Studio info Before |
| 39 | + run: | |
| 40 | + & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -format json |
| 41 | + shell: pwsh |
| 42 | + |
| 43 | + - name: Visual Studio 2019 Reinstall |
| 44 | + shell: cmd |
| 45 | + run: | |
| 46 | + @echo off |
| 47 | + echo Preparing setup |
| 48 | + curl -fLO https://download.visualstudio.microsoft.com/download/pr/1fbe074b-8ae1-4e9b-8e83-d1ce4200c9d1/61098e228df7ba3a6a8b4e920a415ad8878d386de6dd0f23f194fe1a55db189a/vs_Enterprise.exe |
| 49 | + vs_Enterprise.exe --quiet --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.CLI.Support --add Microsoft.VisualStudio.Component.Windows10SDK.19041 --add Microsoft.VisualStudio.Workload.UniversalBuildTools --add Microsoft.VisualStudio.Component.VC.CMake.Project |
| 50 | + echo Waiting for VS2019 setup |
| 51 | + set "ProcessName=setup.exe" |
| 52 | + :CheckProcess |
| 53 | + tasklist /FI "IMAGENAME eq %ProcessName%" | find /I "%ProcessName%" >nul |
| 54 | + if %errorlevel%==0 ( |
| 55 | + ping 127.0.0.1 /n 5 >nul |
| 56 | + goto CheckProcess |
| 57 | + ) |
| 58 | + echo VS2019 Setup completed |
| 59 | + exit /b 0 |
| 60 | +
|
| 61 | + - name: Disable Visual Studio 2022 by Renaming |
| 62 | + run: | |
| 63 | + Rename-Item "C:\Program Files\Microsoft Visual Studio\2022\Enterprise" "Enterprise_DISABLED" |
| 64 | + shell: pwsh |
| 65 | + |
| 66 | + - name: Display full Visual Studio info After |
| 67 | + run: | |
| 68 | + & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -all -products * -format json |
| 69 | + shell: pwsh |
| 70 | + |
| 71 | + - name: Download and install win64devkit |
| 72 | + run: | |
| 73 | + curl -L https://github.com/skeeto/w64devkit/releases/download/v1.22.0/w64devkit-1.22.0.zip --output w64devkit.zip |
| 74 | + Expand-Archive w64devkit.zip -DestinationPath . |
| 75 | +
|
| 76 | + - name: Add w64devkit to PATH |
| 77 | + run: | |
| 78 | + echo "$(Get-Location)\w64devkit\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 |
| 79 | +
|
| 80 | + - name: Print System Environment Variables |
| 81 | + id: printvars |
| 82 | + run: | |
| 83 | + echo "Number of processors: ${env:NUMBER_OF_PROCESSORS}" |
| 84 | + echo "Processor Architecture: ${env:PROCESSOR_ARCHITECTURE}" |
| 85 | + echo "Computer Name: ${env:COMPUTERNAME}" |
| 86 | + wmic cpu get name |
| 87 | + wmic os get TotalVisibleMemorySize, FreePhysicalMemory |
| 88 | +
|
| 89 | + - name: Build Non-CUDA |
| 90 | + id: make_build |
| 91 | + run: | |
| 92 | + make LLAMA_CLBLAST=1 LLAMA_VULKAN=1 LLAMA_PORTABLE=1 -j ${env:NUMBER_OF_PROCESSORS} LLAMA_NOAVX1=1 |
| 93 | +
|
| 94 | + - name: Package PyInstallers |
| 95 | + id: make_pyinstaller |
| 96 | + run: | |
| 97 | + ./make_pyinstaller_oldpc.bat |
| 98 | +
|
| 99 | + - name: Save artifact |
| 100 | + uses: actions/upload-artifact@v4 |
| 101 | + with: |
| 102 | + name: kcpp_windows_pyinstallers |
| 103 | + path: dist/ |
0 commit comments