Browse Source

fix linux archive

Michael Yang 2 months ago
parent
commit
f9d2d89135
2 changed files with 7 additions and 10 deletions
  1. 4 9
      .github/workflows/release.yaml
  2. 3 1
      scripts/build_darwin.sh

+ 4 - 9
.github/workflows/release.yaml

@@ -326,7 +326,7 @@ jobs:
           PLATFORM: ${{ matrix.os }}/${{ matrix.arch }}
       - uses: actions/upload-artifact@v4
         with:
-          name: dist-${{ matrix.os }}-${{ matrix.arch }}
+          name: dist-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.target }}
           path: |
             dist/*.tgz
 
@@ -391,9 +391,6 @@ jobs:
       GH_TOKEN: ${{ github.token }}
     steps:
       - uses: actions/checkout@v4
-      - name: Set Version
-        shell: bash
-        run: |
       - uses: actions/download-artifact@v4
         with:
           name: dist-darwin
@@ -406,11 +403,9 @@ jobs:
         with:
           pattern: dist-linux-*
           path: dist
-      - run: |
-          ls -lh dist/
-          (cd dist; find . -type f | xargs sha256sum > ../sha256sum.txt)
-          mv sha256sum.txt dist/
-          cat dist/sha256sum.txt
+          merge-multiple: true
+      - run: find . -type f -not -name 'sha256sum.txt' | xargs sha256sum | tee sha256sum.txt
+        working-directory: dist
       - name: Create or update Release
         run: |
           RELEASE_VERSION=$(echo ${GITHUB_REF_NAME} | cut -f1 -d-)"

+ 3 - 1
scripts/build_darwin.sh

@@ -34,7 +34,8 @@ _build_darwin() {
                 -DCMAKE_OSX_ARCHITECTURES=x86_64 \
                 -DCMAKE_OSX_DEPLOYMENT_TARGET=11.3
             cmake --build build/darwin-$ARCH --target ggml-cpu -j
-            install build/darwin-$ARCH/lib/ollama/*.{dylib,so} $INSTALL_PREFIX
+            install -d $INSTALL_PREFIX/lib/ollama
+            install build/darwin-$ARCH/lib/ollama/*.{dylib,so} $INSTALL_PREFIX/lib/ollama
         fi
     done
 }
@@ -43,6 +44,7 @@ _sign_darwin() {
     status "Creating universal binary..."
     mkdir -p dist/darwin
     lipo -create -output dist/darwin/ollama dist/darwin-*/ollama
+    chmod +x dist/darwin/ollama
 
     if [ -n "$APPLE_IDENTITY" ]; then
         for F in dist/darwin/ollama dist/darwin-amd64/lib/ollama/*; do