@@ -710,12 +710,11 @@ jobs:
710710 -DLLAMA_BUILD_SERVER=OFF \
711711 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
712712 cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
713- sudo cmake --install build --config Release
714713
715714 - name : xcodebuild for swift package
716715 id : xcodebuild
717716 run : |
718- xcodebuild -scheme llama-Package -destination "${{ matrix.destination }}"
717+ ./build-xcframework.sh
719718
720719 windows-msys2 :
721720 runs-on : windows-latest
@@ -1336,15 +1335,40 @@ jobs:
13361335 -DCMAKE_OSX_DEPLOYMENT_TARGET=14.0 \
13371336 -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM=ggml
13381337 cmake --build build --config Release -j $(sysctl -n hw.logicalcpu) -- CODE_SIGNING_ALLOWED=NO
1339- sudo cmake --install build --config Release
13401338
13411339 - name : xcodebuild for swift package
13421340 id : xcodebuild
13431341 run : |
1344- xcodebuild -scheme llama-Package -destination 'generic/platform=iOS'
1342+ ./build-xcframework.sh
13451343
13461344 - name : Build Xcode project
1347- run : xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' build
1345+ run : xcodebuild -project examples/llama.swiftui/llama.swiftui.xcodeproj -scheme llama.swiftui -sdk iphoneos CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= -destination 'generic/platform=iOS' FRAMEWORK_FOLDER_PATH=./build-ios build
1346+
1347+ - name : Determine tag name
1348+ id : tag
1349+ shell : bash
1350+ run : |
1351+ BUILD_NUMBER="$(git rev-list --count HEAD)"
1352+ SHORT_HASH="$(git rev-parse --short=7 HEAD)"
1353+ if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
1354+ echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
1355+ else
1356+ SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
1357+ echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
1358+ fi
1359+
1360+ - name : Pack artifacts
1361+ id : pack_artifacts
1362+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1363+ run : |
1364+ zip -r llama-${{ steps.tag.outputs.name }}-xcframework.zip build-apple/llama.xcframework
1365+
1366+ - name : Upload artifacts
1367+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
1368+ uses : actions/upload-artifact@v4
1369+ with :
1370+ path : llama-${{ steps.tag.outputs.name }}-xcframework.zip
1371+ name : llama-${{ steps.tag.outputs.name }}-xcframework
13481372
13491373 android-build :
13501374 runs-on : ubuntu-latest
0 commit comments