From 816250036d4ee39b802b26c3c3fe541cf06dfd7c Mon Sep 17 00:00:00 2001
From: slaren <slarengh@gmail.com>
Date: Sun, 1 Dec 2024 23:38:18 +0100
Subject: [PATCH] wip4

---
 .github/workflows/build.yml | 62 ++++++++++++++-----------------------
 1 file changed, 23 insertions(+), 39 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index e4599c85181dee..cf14292322581f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -41,7 +41,6 @@ jobs:
       matrix:
         arch: [avx, avx2, avx512, amx]
         include:
-          - { sys: UCRT64, env: ucrt-x86_64, build: Release }
           - { arch: avx,    defines: '-DGGML_AVX=ON -DGGML_AVX2=OFF -DGGML_AVX512=OFF -DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF' }
           - { arch: avx2,   defines: '-DGGML_AVX=ON -DGGML_AVX2=ON  -DGGML_AVX512=OFF -DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF' }
           - { arch: avx512, defines: '-DGGML_AVX=ON -DGGML_AVX2=ON  -DGGML_AVX512=ON  -DGGML_AMX_TILE=OFF -DGGML_AMX_INT8=OFF' }
@@ -51,22 +50,14 @@ jobs:
       - name: Clone
         uses: actions/checkout@v4
 
-      - name: Setup ${{ matrix.sys }}
-        uses: msys2/setup-msys2@v2
-        with:
-          update: true
-          msystem: ${{matrix.sys}}
-          install: >-
-            base-devel
-            mingw-w64-${{matrix.env}}-toolchain
-            mingw-w64-${{matrix.env}}-cmake
-            mingw-w64-${{matrix.env}}-ninja
+      - name: Install Ninja
+        run: |
+          choco install ninja
 
       - name: Build using CMake
-        shell: msys2 {0}
         run: |
             cmake -B build -G "Ninja Multi-Config" -DGGML_NATIVE=OFF -DBUILD_SHARED_LIBS=ON -DGGML_BACKEND_DL=ON ${{ matrix.defines }}
-            cmake --build build --config ${{ matrix.build }} -t ggml-cpu
+            cmake --build build --config Release -t ggml-cpu
 
       - name: Rename artifacts
         run: mv build/bin/Release/ggml-cpu.dll ggml-cpu-${{ matrix.arch }}.dll
@@ -81,14 +72,8 @@ jobs:
   windows-msys2-x86_64:
     runs-on: windows-latest
 
-    needs:
-      - windows-msys2-cpu-x86_64
-
-    strategy:
-      fail-fast: false
-      matrix:
-        include:
-          - { sys: UCRT64, env: ucrt-x86_64, build: Release }
+    #needs:
+    #  - windows-msys2-cpu-x86_64
 
     steps:
       - name: Clone
@@ -96,24 +81,23 @@ jobs:
         with:
           fetch-depth: 0
 
-      - name: Setup ${{ matrix.sys }}
-        uses: msys2/setup-msys2@v2
-        with:
-          update: true
-          msystem: ${{matrix.sys}}
-          install: >-
-            base-devel
-            git
-            mingw-w64-${{matrix.env}}-toolchain
-            mingw-w64-${{matrix.env}}-cmake
-            mingw-w64-${{matrix.env}}-ninja
-            mingw-w64-${{matrix.env}}-curl
+      - name: Install Ninja
+        run: |
+          choco install ninja
+
+      - name: Install curl
+        run: |
+          curl.exe -O https://curl.se/windows/dl-8.11.0_4/curl-8.11.0_4-win64-mingw.zip
+          7z x curl-8.11.0_4-win64-mingw.zip
+
+      - name: Configure using CMake
+        run: >
+            cmake -B build -G "Ninja Multi-Config" -DLLAMA_CURL=ON -DLLAMA_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DGGML_BACKEND_DL=ON -DCURL_USE_STATIC_LIBS=ON
+              -DCURL_INCLUDE_DIR="curl-8.11.0_4-win64-mingw/include/" -DCURL_LIBRARY="curl-8.11.0_4-win64-mingw/lib/libcurl.a" -DCURL_USE_STATIC_LIBS=ON
 
       - name: Build using CMake
-        shell: msys2 {0}
         run: |
-            cmake -B build -G "Ninja Multi-Config" -DLLAMA_CURL=ON -DLLAMA_BUILD_TESTS=OFF -DBUILD_SHARED_LIBS=ON -DGGML_BACKEND_DL=ON
-            cmake --build build --config ${{ matrix.build }}
+            cmake --build build --config Release
             rm build/bin/Release/ggml-cpu.dll
 
       - name: Download CPU backend artifacts
@@ -141,15 +125,15 @@ jobs:
         if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
         run: |
           Copy-Item LICENSE .\build\bin\Release\llama.cpp.txt
-          7z a llama-${{ steps.tag.outputs.name }}-bin-msys2-cpu-${{ matrix.build }}.zip .\build\bin\Release\*
+          7z a llama-${{ steps.tag.outputs.name }}-bin-msys2-cpu.zip .\build\bin\Release\*
 
       - name: Upload artifacts
         id: upload_artifacts
         if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
         uses: actions/upload-artifact@v4
         with:
-          path: llama-${{ steps.tag.outputs.name }}-bin-msys2-cpu-${{ matrix.build }}.zip
-          name: llama-${{ steps.tag.outputs.name }}-bin-msys2-cpu-${{ matrix.build }}.zip
+          path: llama-${{ steps.tag.outputs.name }}-bin-msys2-cpu.zip
+          name: llama-${{ steps.tag.outputs.name }}-bin-msys2-cpu.zip
 
   release:
     if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}