diff --git a/.github/workflows/myexe.yaml b/.github/workflows/myexe.yaml index f92e231dd02..abd3f0d2e0b 100644 --- a/.github/workflows/myexe.yaml +++ b/.github/workflows/myexe.yaml @@ -6,38 +6,57 @@ on: branches: [main] jobs: - build-windows: - runs-on: windows-latest - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '1.22' - - - name: Install Dependencies - run: | - # Example: Install Windows SDK for signtool, if needed - choco install windows-sdk-10.1 -y - # Add commands here to install any other dependencies required for your project - - - name: Prepare Environment - run: | - # Set up any environment variables or paths needed for the build - # Example for CUDA, adjust as per actual requirements - $cudaInstallPath = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.3\bin" - echo "CUDA_PATH=$cudaInstallPath" | Out-File -Append -FilePath $env:GITHUB_ENV - echo "$cudaInstallPath" | Out-File -Append -FilePath $env:GITHUB_PATH - - - name: Build Executable - run: | - go build -o myapp.exe ./... - # Adjust the build command as necessary for your project - - - name: Upload EXE as Artifact - uses: actions/upload-artifact@v4 - with: - name: windows-exe - path: myapp.exe +build-windows: + environment: release + runs-on: windows + needs: + - generate-windows-cuda + - generate-windows-rocm + - generate-windows-cpu + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Set Version + shell: bash + run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV + - uses: actions/setup-go@v5 + with: + go-version: '1.22' + cache: true + - run: go get + - uses: actions/download-artifact@v4 + with: + name: generate-windows-cpu + path: llm/llama.cpp/build + - uses: actions/download-artifact@v4 + with: + name: generate-windows-cuda + path: llm/llama.cpp/build + - uses: actions/download-artifact@v4 + with: + name: windows-cuda-deps + path: dist/deps + - uses: actions/download-artifact@v4 + with: + name: windows-rocm-deps + path: dist/deps + - uses: actions/download-artifact@v4 + with: + name: generate-windows-rocm + path: llm/llama.cpp/build + - run: dir llm/llama.cpp/build + - run: | + $gopath=(get-command go).source | split-path -parent + & "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" + cd $env:GITHUB_WORKSPACE + $env:CMAKE_SYSTEM_VERSION="10.0.22621.0" + $env:PATH="$gopath;$env:PATH" + $env:OLLAMA_SKIP_GENERATE="1" + $env:NVIDIA_DIR=$(resolve-path ".\dist\deps") + $env:HIP_PATH=$(resolve-path ".\dist\deps") + & .\scripts\build_windows.ps1 + - uses: actions/upload-artifact@v4 + with: + name: dist-windows + path: dist/*.exe \ No newline at end of file