Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
ollama
Commits
669dc31c
Commit
669dc31c
authored
Feb 03, 2025
by
Michael Yang
Browse files
fix build
parent
d4d338c2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
7 deletions
+27
-7
.github/workflows/release.yaml
.github/workflows/release.yaml
+26
-6
scripts/build_darwin.sh
scripts/build_darwin.sh
+1
-1
No files found.
.github/workflows/release.yaml
View file @
669dc31c
...
@@ -273,6 +273,8 @@ jobs:
...
@@ -273,6 +273,8 @@ jobs:
merge-multiple
:
true
merge-multiple
:
true
-
run
:
|
-
run
:
|
& .\scripts\build_windows.ps1 gatherDependencies sign buildInstaller distZip
& .\scripts\build_windows.ps1 gatherDependencies sign buildInstaller distZip
env
:
KEY_CONTAINER
:
${{ vars.KEY_CONTAINER }}
-
uses
:
actions/upload-artifact@v4
-
uses
:
actions/upload-artifact@v4
with
:
with
:
name
:
dist-windows
name
:
dist-windows
...
@@ -286,10 +288,13 @@ jobs:
...
@@ -286,10 +288,13 @@ jobs:
include
:
include
:
-
os
:
linux
-
os
:
linux
arch
:
amd64
arch
:
amd64
targets
:
'
archive
rocm'
target
:
archive
-
os
:
linux
arch
:
amd64
target
:
rocm
-
os
:
linux
-
os
:
linux
arch
:
arm64
arch
:
arm64
target
s
:
archive
target
:
archive
runs-on
:
${{ matrix.arch == 'arm64' && format('{0}-{1}', matrix.os, matrix.arch) || matrix.os }}
runs-on
:
${{ matrix.arch == 'arm64' && format('{0}-{1}', matrix.os, matrix.arch) || matrix.os }}
environment
:
release
environment
:
release
needs
:
setup-environment
needs
:
setup-environment
...
@@ -300,15 +305,30 @@ jobs:
...
@@ -300,15 +305,30 @@ jobs:
-
uses
:
docker/setup-buildx-action@v3
-
uses
:
docker/setup-buildx-action@v3
-
run
:
|
-
run
:
|
sudo apt-get update && sudo apt-get install pigz
sudo apt-get update && sudo apt-get install pigz
for TARGET in ${{ matrix.targets }}; do docker buildx build --platform $PLATFORM --target $TARGET --build-arg GOFLAGS --build-arg CGO_CFLAGS --build-arg CGO_CXXFLAGS --output type=local,dest=dist/$PLATFORM .; done
docker buildx build --platform $PLATFORM --target ${{ matrix.target }} --build-arg GOFLAGS --build-arg CGO_CFLAGS --build-arg CGO_CXXFLAGS --output type=local,dest=dist/$PLATFORM .
tar c -C dist/$PLATFORM . | pigz -9cv >dist/ollama-${PLATFORM//\//-}.tgz
for COMPONENTS in dist/$PLATFORM/* dist/$PLATFORM/lib/ollama/*; do
if [ -d "$COMPONENTS" ]; then
case "$COMPONENTS" in
*/bin) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}.tar.in ;;
*/lib/ollama) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}.tar.in;;
*/lib/ollama/cuda_v11) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}.tar.in;;
*/lib/ollama/cuda_v12) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}.tar.in;;
*/lib/ollama/cuda_jetpack5) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}-jetpack5.tar.in ;;
*/lib/ollama/cuda_jetpack6) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}-jetpack6.tar.in ;;
*/lib/ollama/rocm) echo $COMPONENTS >>dist/ollama-${PLATFORM//\//-}-rocm.tar.in ;;
esac
fi
done
for ARCHIVE in dist/*.tar.in; do tar c -T $ARCHIVE --strip-components 3 | pigz -9cv >${ARCHIVE//.*/}.tgz; done
env
:
env
:
PLATFORM
:
${{ matrix.os }}/${{ matrix.arch }}
PLATFORM
:
${{ matrix.os }}/${{ matrix.arch }}
-
uses
:
actions/upload-artifact@v4
-
uses
:
actions/upload-artifact@v4
with
:
with
:
name
:
dist-${{ matrix.os }}-${{ matrix.arch }}
name
:
dist-${{ matrix.os }}-${{ matrix.arch }}
path
:
|
path
:
|
dist/
ollama-${{ matrix.os }}-${{ matrix.arch }}
.tgz
dist/
*
.tgz
docker-build
:
docker-build
:
strategy
:
strategy
:
...
@@ -320,7 +340,7 @@ jobs:
...
@@ -320,7 +340,7 @@ jobs:
CGO_CFLAGS
CGO_CFLAGS
CGO_CXXFLAGS
CGO_CXXFLAGS
GOFLAGS
GOFLAGS
-
flavor
:
'
latest=false,suffix=rocm'
-
flavor
:
'
latest=false,suffix=
-
rocm'
platforms
:
linux/amd64
platforms
:
linux/amd64
build-args
:
|
build-args
:
|
CGO_CFLAGS
CGO_CFLAGS
...
...
scripts/build_darwin.sh
View file @
669dc31c
...
@@ -52,7 +52,7 @@ _sign_darwin() {
...
@@ -52,7 +52,7 @@ _sign_darwin() {
# create a temporary zip for notarization
# create a temporary zip for notarization
TEMP
=
$(
mktemp
-u
)
.zip
TEMP
=
$(
mktemp
-u
)
.zip
ditto
-c
-k
--keepParent
dist/darwin/ollama
"
$TEMP
"
ditto
-c
-k
--keepParent
dist/darwin/ollama
"
$TEMP
"
xcrun notarytool submit
dist/darwin/temp.zip
--wait
--timeout
10m
--apple-id
$APPLE_ID
--password
$APPLE_PASSWORD
--team-id
$APPLE_TEAM_ID
xcrun notarytool submit
"
$TEMP
"
--wait
--timeout
10m
--apple-id
$APPLE_ID
--password
$APPLE_PASSWORD
--team-id
$APPLE_TEAM_ID
rm
-f
"
$TEMP
"
rm
-f
"
$TEMP
"
fi
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment