2023-07-28 12:38:48 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
mkdir -p dist
|
|
|
|
|
2023-07-28 12:23:50 -07:00
|
|
|
# build universal binary
|
2023-07-31 20:50:30 -04:00
|
|
|
CGO_ENABLED=1 GOARCH=arm64 go build -o dist/ollama-darwin-arm64
|
|
|
|
CGO_ENABLED=1 GOARCH=amd64 go build -o dist/ollama-darwin-amd64
|
|
|
|
lipo -create -output dist/ollama dist/ollama-darwin-arm64 dist/ollama-darwin-amd64
|
|
|
|
rm dist/ollama-darwin-amd64 dist/ollama-darwin-arm64
|
2023-07-28 12:23:50 -07:00
|
|
|
codesign --deep --force --options=runtime --sign "$APPLE_IDENTITY" --timestamp dist/ollama
|
2023-08-07 18:10:37 -04:00
|
|
|
chmod +x dist/ollama
|
2023-07-28 12:38:48 -04:00
|
|
|
|
|
|
|
# build and sign the mac app
|
2023-08-01 17:39:04 -04:00
|
|
|
npm install --prefix app
|
2023-07-28 12:38:48 -04:00
|
|
|
npm run --prefix app make:sign
|
2023-07-29 10:13:10 -07:00
|
|
|
cp app/out/make/zip/darwin/universal/Ollama-darwin-universal-${VERSION:-0.0.0}.zip dist/Ollama-darwin.zip
|
2023-07-28 12:38:48 -04:00
|
|
|
|
2023-07-28 12:23:50 -07:00
|
|
|
# sign the binary and rename it
|
|
|
|
codesign -f --timestamp -s "$APPLE_IDENTITY" --identifier ai.ollama.ollama --options=runtime dist/ollama
|
|
|
|
ditto -c -k --keepParent dist/ollama dist/temp.zip
|
|
|
|
xcrun notarytool submit dist/temp.zip --wait --timeout 10m --apple-id $APPLE_ID --password $APPLE_PASSWORD --team-id $APPLE_TEAM_ID
|
2023-07-28 12:38:48 -04:00
|
|
|
mv dist/ollama dist/ollama-darwin
|
2023-07-28 12:23:50 -07:00
|
|
|
rm dist/temp.zip
|