"vscode:/vscode.git/clone" did not exist on "11974812ca06b387b481e3d3d507290a86974d1f"
Commit 204349b1 authored by Hernan Martinez's avatar Hernan Martinez
Browse files

Use architecture specific folders in the build script

parent 86e67fc4
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
$ErrorActionPreference = "Stop" $ErrorActionPreference = "Stop"
function checkEnv() { function checkEnv() {
$script:TARGET_ARCH=$Env:PROCESSOR_ARCHITECTURE.ToLower()
Write-host "Building for ${script:TARGET_ARCH}"
write-host "Locating required tools and paths" write-host "Locating required tools and paths"
$script:SRC_DIR=$PWD $script:SRC_DIR=$PWD
if (!$env:VCToolsRedistDir) { if (!$env:VCToolsRedistDir) {
...@@ -30,7 +32,7 @@ function checkEnv() { ...@@ -30,7 +32,7 @@ function checkEnv() {
$script:INNO_SETUP_DIR=(get-item "C:\Program Files*\Inno Setup*\")[0] $script:INNO_SETUP_DIR=(get-item "C:\Program Files*\Inno Setup*\")[0]
$script:DEPS_DIR="${script:SRC_DIR}\dist\windows-amd64" $script:DEPS_DIR="${script:SRC_DIR}\dist\windows-${script:TARGET_ARCH}"
$env:CGO_ENABLED="1" $env:CGO_ENABLED="1"
echo "Checking version" echo "Checking version"
if (!$env:VERSION) { if (!$env:VERSION) {
...@@ -81,8 +83,8 @@ function buildOllama() { ...@@ -81,8 +83,8 @@ function buildOllama() {
/csp "Google Cloud KMS Provider" /kc ${env:KEY_CONTAINER} ollama.exe /csp "Google Cloud KMS Provider" /kc ${env:KEY_CONTAINER} ollama.exe
if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)} if ($LASTEXITCODE -ne 0) { exit($LASTEXITCODE)}
} }
New-Item -ItemType Directory -Path .\dist\windows-amd64\ -Force New-Item -ItemType Directory -Path .\dist\windows-${script:TARGET_ARCH}\ -Force
cp .\ollama.exe .\dist\windows-amd64\ cp .\ollama.exe .\dist\windows-${script:TARGET_ARCH}\
} }
function buildApp() { function buildApp() {
...@@ -135,8 +137,8 @@ function buildInstaller() { ...@@ -135,8 +137,8 @@ function buildInstaller() {
} }
function distZip() { function distZip() {
write-host "Generating stand-alone distribution zip file ${script:SRC_DIR}\dist\ollama-windows-amd64.zip" write-host "Generating stand-alone distribution zip file ${script:SRC_DIR}\dist\ollama-windows-${script:TARGET_ARCH}.zip"
Compress-Archive -Path "${script:SRC_DIR}\dist\windows-amd64\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-amd64.zip" -Force Compress-Archive -Path "${script:SRC_DIR}\dist\windows-${script:TARGET_ARCH}\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-${script:TARGET_ARCH}.zip" -Force
} }
try { try {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment