Skip to content

Commit

Permalink
support windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lux committed Aug 8, 2024
1 parent 9ceb136 commit 8ffb70d
Showing 1 changed file with 74 additions and 74 deletions.
148 changes: 74 additions & 74 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -266,79 +266,79 @@ jobs:
path: dist/deps/*

# Import the prior generation steps and build the final windows assets
# build-windows:
# environment: release
# runs-on: windows
# needs:
# - generate-windows-cuda
# - generate-windows-rocm
# - generate-windows-cpu
# env:
# KEY_CONTAINER: ${{ vars.KEY_CONTAINER }}
# steps:
# - uses: actions/checkout@v4
# with:
# submodules: recursive
# - name: Set Version
# shell: bash
# run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
# - uses: 'google-github-actions/auth@v2'
# with:
# project_id: 'ollama'
# credentials_json: '${{ secrets.GOOGLE_SIGNING_CREDENTIALS }}'
# - run: echo "${{ vars.OLLAMA_CERT }}" > ollama_inc.crt
# - name: install Windows SDK 8.1 to get signtool
# run: |
# $ErrorActionPreference = "Stop"
# write-host "downloading SDK"
# Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=323507" -OutFile "${env:RUNNER_TEMP}\sdksetup.exe"
# Start-Process "${env:RUNNER_TEMP}\sdksetup.exe" -ArgumentList @("/q") -NoNewWindow -Wait
# write-host "Win SDK 8.1 installed"
# gci -path 'C:\Program Files (x86)\Windows Kits\' -r -fi 'signtool.exe'
# - name: install signing plugin
# run: |
# $ErrorActionPreference = "Stop"
# write-host "downloading plugin"
# Invoke-WebRequest -Uri "https://github.com/GoogleCloudPlatform/kms-integrations/releases/download/cng-v1.0/kmscng-1.0-windows-amd64.zip" -OutFile "${env:RUNNER_TEMP}\plugin.zip"
# Expand-Archive -Path "${env:RUNNER_TEMP}\plugin.zip" -DestinationPath ${env:RUNNER_TEMP}\plugin\
# write-host "Installing plugin"
# & "${env:RUNNER_TEMP}\plugin\*\kmscng.msi" /quiet
# write-host "plugin installed"
# - uses: actions/setup-go@v5
# with:
# go-version: "stable"
# cache: true
# - run: go get
# - uses: actions/download-artifact@v4
# with:
# name: generate-windows-cpu
# - uses: actions/download-artifact@v4
# with:
# name: generate-windows-cuda
# - uses: actions/download-artifact@v4
# with:
# name: windows-cuda-deps
# - uses: actions/download-artifact@v4
# with:
# name: windows-rocm-deps
# - uses: actions/download-artifact@v4
# with:
# name: generate-windows-rocm
# - run: dir llm/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"
# & .\scripts\build_windows.ps1
# - uses: actions/upload-artifact@v4
# with:
# name: dist-windows
# path: |
# dist/OllamaSetup.exe
# dist/ollama-windows-*.zip
build-windows:
environment: release
runs-on: windows
needs:
- generate-windows-cuda
- generate-windows-rocm
- generate-windows-cpu
env:
KEY_CONTAINER: ${{ vars.KEY_CONTAINER }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set Version
shell: bash
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- uses: 'google-github-actions/auth@v2'
with:
project_id: 'ollama'
credentials_json: '${{ secrets.GOOGLE_SIGNING_CREDENTIALS }}'
- run: echo "${{ vars.OLLAMA_CERT }}" > ollama_inc.crt
- name: install Windows SDK 8.1 to get signtool
run: |
$ErrorActionPreference = "Stop"
write-host "downloading SDK"
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?LinkId=323507" -OutFile "${env:RUNNER_TEMP}\sdksetup.exe"
Start-Process "${env:RUNNER_TEMP}\sdksetup.exe" -ArgumentList @("/q") -NoNewWindow -Wait
write-host "Win SDK 8.1 installed"
gci -path 'C:\Program Files (x86)\Windows Kits\' -r -fi 'signtool.exe'
- name: install signing plugin
run: |
$ErrorActionPreference = "Stop"
write-host "downloading plugin"
Invoke-WebRequest -Uri "https://github.com/GoogleCloudPlatform/kms-integrations/releases/download/cng-v1.0/kmscng-1.0-windows-amd64.zip" -OutFile "${env:RUNNER_TEMP}\plugin.zip"
Expand-Archive -Path "${env:RUNNER_TEMP}\plugin.zip" -DestinationPath ${env:RUNNER_TEMP}\plugin\
write-host "Installing plugin"
& "${env:RUNNER_TEMP}\plugin\*\kmscng.msi" /quiet
write-host "plugin installed"
- uses: actions/setup-go@v5
with:
go-version: "stable"
cache: true
- run: go get
- uses: actions/download-artifact@v4
with:
name: generate-windows-cpu
- uses: actions/download-artifact@v4
with:
name: generate-windows-cuda
- uses: actions/download-artifact@v4
with:
name: windows-cuda-deps
- uses: actions/download-artifact@v4
with:
name: windows-rocm-deps
- uses: actions/download-artifact@v4
with:
name: generate-windows-rocm
- run: dir llm/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"
& .\scripts\build_windows.ps1
- uses: actions/upload-artifact@v4
with:
name: dist-windows
path: |
dist/OllamaSetup.exe
dist/ollama-windows-*.zip
# Linux x86 assets built using the container based build
build-linux-amd64:
Expand Down Expand Up @@ -427,7 +427,7 @@ jobs:
release:
needs:
# - build-darwin
# - build-windows
- build-windows
- build-linux-amd64
# - build-linux-arm64
runs-on: linux
Expand Down

0 comments on commit 8ffb70d

Please sign in to comment.