@@ -1119,3 +1119,89 @@ jobs:
11191119 for tag in $(echo "${{ steps.quaymeta.outputs.tags }}" | tr ',' '\n'); do
11201120 crane push llama-cpp.tar $tag
11211121 done
1122+ mlx-darwin :
1123+ runs-on : macOS-14
1124+ strategy :
1125+ matrix :
1126+ go-version : ['1.24.x']
1127+ steps :
1128+ - name : Clone
1129+ uses : actions/checkout@v5
1130+ with :
1131+ submodules : true
1132+ - name : Setup Go ${{ matrix.go-version }}
1133+ uses : actions/setup-go@v5
1134+ with :
1135+ go-version : ${{ matrix.go-version }}
1136+ cache : false
1137+ # You can test your matrix by printing the current Go version
1138+ - name : Display Go version
1139+ run : go version
1140+ - name : Dependencies
1141+ run : |
1142+ brew install protobuf grpc make protoc-gen-go protoc-gen-go-grpc libomp llvm
1143+ - name : Build mlx-darwin
1144+ run : |
1145+ make protogen-go
1146+ make backends/mlx
1147+ - name : Upload mlx.tar
1148+ uses : actions/upload-artifact@v4
1149+ with :
1150+ name : mlx-tar
1151+ path : backend-images/mlx.tar
1152+ mlx-darwin-publish :
1153+ needs : mlx-darwin
1154+ if : github.event_name != 'pull_request'
1155+ runs-on : ubuntu-latest
1156+ steps :
1157+ - name : Download mlx.tar
1158+ uses : actions/download-artifact@v5
1159+ with :
1160+ name : mlx-tar
1161+ path : .
1162+ - name : Install crane
1163+ run : |
1164+ curl -L https://github.com/google/go-containerregistry/releases/latest/download/go-containerregistry_Linux_x86_64.tar.gz | tar -xz
1165+ sudo mv crane /usr/local/bin/
1166+ - name : Log in to DockerHub
1167+ run : |
1168+ echo "${{ secrets.DOCKERHUB_PASSWORD }}" | crane auth login docker.io -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
1169+ - name : Log in to quay.io
1170+ run : |
1171+ echo "${{ secrets.LOCALAI_REGISTRY_PASSWORD }}" | crane auth login quay.io -u "${{ secrets.LOCALAI_REGISTRY_USERNAME }}" --password-stdin
1172+ - name : Docker meta
1173+ id : meta
1174+ uses : docker/metadata-action@v5
1175+ with :
1176+ images : |
1177+ localai/localai-backends
1178+ tags : |
1179+ type=ref,event=branch
1180+ type=semver,pattern={{raw}}
1181+ type=sha
1182+ flavor : |
1183+ latest=auto
1184+ suffix=-metal-darwin-arm64-mlx,onlatest=true
1185+ - name : Docker meta
1186+ id : quaymeta
1187+ uses : docker/metadata-action@v5
1188+ with :
1189+ images : |
1190+ quay.io/go-skynet/local-ai-backends
1191+ tags : |
1192+ type=ref,event=branch
1193+ type=semver,pattern={{raw}}
1194+ type=sha
1195+ flavor : |
1196+ latest=auto
1197+ suffix=-metal-darwin-arm64-mlx,onlatest=true
1198+ - name : Push Docker image (DockerHub)
1199+ run : |
1200+ for tag in $(echo "${{ steps.meta.outputs.tags }}" | tr ',' '\n'); do
1201+ crane push mlx.tar $tag
1202+ done
1203+ - name : Push Docker image (Quay)
1204+ run : |
1205+ for tag in $(echo "${{ steps.quaymeta.outputs.tags }}" | tr ',' '\n'); do
1206+ crane push mlx.tar $tag
1207+ done
0 commit comments