mirror of
https://github.com/mudler/LocalAI.git
synced 2024-12-18 20:27:57 +00:00
feat(single-build): generate single binaries for releases (#2246)
* feat(single-build): generate single binaries for releases Signed-off-by: Ettore Di Giacinto <mudler@localai.io> * drop old targets Signed-off-by: Ettore Di Giacinto <mudler@localai.io> --------- Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
67ad3532ec
commit
c5798500cb
68
.github/workflows/release.yaml
vendored
68
.github/workflows/release.yaml
vendored
@ -19,12 +19,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- build: 'avx2'
|
- build: ''
|
||||||
defines: ''
|
defines: ''
|
||||||
- build: 'avx'
|
|
||||||
defines: '-DLLAMA_AVX2=OFF'
|
|
||||||
- build: 'avx512'
|
|
||||||
defines: '-DLLAMA_AVX512=ON'
|
|
||||||
- build: 'cuda12'
|
- build: 'cuda12'
|
||||||
defines: ''
|
defines: ''
|
||||||
- build: 'cuda11'
|
- build: 'cuda11'
|
||||||
@ -74,7 +70,6 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
env:
|
env:
|
||||||
CMAKE_ARGS: "${{ matrix.defines }}"
|
|
||||||
BUILD_ID: "${{ matrix.build }}"
|
BUILD_ID: "${{ matrix.build }}"
|
||||||
run: |
|
run: |
|
||||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||||
@ -124,63 +119,7 @@ jobs:
|
|||||||
name: stablediffusion
|
name: stablediffusion
|
||||||
path: release/
|
path: release/
|
||||||
|
|
||||||
build-macOS:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- build: 'avx2'
|
|
||||||
defines: ''
|
|
||||||
- build: 'avx'
|
|
||||||
defines: '-DLLAMA_AVX2=OFF'
|
|
||||||
- build: 'avx512'
|
|
||||||
defines: '-DLLAMA_AVX512=ON'
|
|
||||||
runs-on: macOS-latest
|
|
||||||
steps:
|
|
||||||
- name: Clone
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
submodules: true
|
|
||||||
- uses: actions/setup-go@v5
|
|
||||||
with:
|
|
||||||
go-version: '1.21.x'
|
|
||||||
cache: false
|
|
||||||
- name: Dependencies
|
|
||||||
run: |
|
|
||||||
brew install protobuf grpc
|
|
||||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
|
||||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
|
||||||
- name: Build
|
|
||||||
id: build
|
|
||||||
env:
|
|
||||||
CMAKE_ARGS: "${{ matrix.defines }}"
|
|
||||||
BUILD_ID: "${{ matrix.build }}"
|
|
||||||
run: |
|
|
||||||
export C_INCLUDE_PATH=/usr/local/include
|
|
||||||
export CPLUS_INCLUDE_PATH=/usr/local/include
|
|
||||||
export PATH=$PATH:$GOPATH/bin
|
|
||||||
make dist
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: LocalAI-MacOS-${{ matrix.build }}
|
|
||||||
path: release/
|
|
||||||
- name: Release
|
|
||||||
uses: softprops/action-gh-release@v2
|
|
||||||
if: startsWith(github.ref, 'refs/tags/')
|
|
||||||
with:
|
|
||||||
files: |
|
|
||||||
release/*
|
|
||||||
|
|
||||||
|
|
||||||
build-macOS-arm64:
|
build-macOS-arm64:
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- build: 'avx2'
|
|
||||||
defines: ''
|
|
||||||
- build: 'avx'
|
|
||||||
defines: '-DLLAMA_AVX2=OFF'
|
|
||||||
- build: 'avx512'
|
|
||||||
defines: '-DLLAMA_AVX512=ON'
|
|
||||||
runs-on: macos-14
|
runs-on: macos-14
|
||||||
steps:
|
steps:
|
||||||
- name: Clone
|
- name: Clone
|
||||||
@ -198,9 +137,6 @@ jobs:
|
|||||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||||
- name: Build
|
- name: Build
|
||||||
id: build
|
id: build
|
||||||
env:
|
|
||||||
CMAKE_ARGS: "${{ matrix.defines }}"
|
|
||||||
BUILD_ID: "${{ matrix.build }}"
|
|
||||||
run: |
|
run: |
|
||||||
export C_INCLUDE_PATH=/usr/local/include
|
export C_INCLUDE_PATH=/usr/local/include
|
||||||
export CPLUS_INCLUDE_PATH=/usr/local/include
|
export CPLUS_INCLUDE_PATH=/usr/local/include
|
||||||
@ -208,7 +144,7 @@ jobs:
|
|||||||
make dist
|
make dist
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: LocalAI-MacOS-arm64-${{ matrix.build }}
|
name: LocalAI-MacOS-arm64
|
||||||
path: release/
|
path: release/
|
||||||
- name: Release
|
- name: Release
|
||||||
uses: softprops/action-gh-release@v2
|
uses: softprops/action-gh-release@v2
|
||||||
|
5
Makefile
5
Makefile
@ -321,7 +321,12 @@ build-api:
|
|||||||
|
|
||||||
dist: build
|
dist: build
|
||||||
mkdir -p release
|
mkdir -p release
|
||||||
|
# if BUILD_ID is empty, then we don't append it to the binary name
|
||||||
|
ifeq ($(BUILD_ID),)
|
||||||
|
cp $(BINARY_NAME) release/$(BINARY_NAME)-$(OS)-$(ARCH)
|
||||||
|
else
|
||||||
cp $(BINARY_NAME) release/$(BINARY_NAME)-$(BUILD_ID)-$(OS)-$(ARCH)
|
cp $(BINARY_NAME) release/$(BINARY_NAME)-$(BUILD_ID)-$(OS)-$(ARCH)
|
||||||
|
endif
|
||||||
|
|
||||||
osx-signed: build
|
osx-signed: build
|
||||||
codesign --deep --force --sign "$(OSX_SIGNING_IDENTITY)" --entitlements "./Entitlements.plist" "./$(BINARY_NAME)"
|
codesign --deep --force --sign "$(OSX_SIGNING_IDENTITY)" --entitlements "./Entitlements.plist" "./$(BINARY_NAME)"
|
||||||
|
Loading…
Reference in New Issue
Block a user