2023-05-23 15:12:48 +00:00
|
|
|
name: Build and Release
|
|
|
|
|
|
|
|
on: push
|
|
|
|
|
2023-05-23 19:47:47 +00:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
|
2023-05-23 15:12:48 +00:00
|
|
|
jobs:
|
|
|
|
build-linux:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- build: 'avx2'
|
|
|
|
defines: ''
|
|
|
|
- build: 'avx'
|
|
|
|
defines: '-DLLAMA_AVX2=OFF'
|
|
|
|
- build: 'avx512'
|
|
|
|
defines: '-DLLAMA_AVX512=ON'
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Clone
|
|
|
|
uses: actions/checkout@v3
|
2023-05-29 21:11:29 +00:00
|
|
|
with:
|
2023-05-23 15:12:48 +00:00
|
|
|
submodules: true
|
2023-08-23 23:18:58 +00:00
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: '>=1.21.0'
|
2023-05-23 15:12:48 +00:00
|
|
|
- name: Dependencies
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install build-essential ffmpeg
|
|
|
|
- name: Build
|
|
|
|
id: build
|
|
|
|
env:
|
2023-05-29 21:11:29 +00:00
|
|
|
CMAKE_ARGS: "${{ matrix.defines }}"
|
2023-05-23 15:12:48 +00:00
|
|
|
BUILD_ID: "${{ matrix.build }}"
|
|
|
|
run: |
|
2023-06-03 21:46:07 +00:00
|
|
|
STATIC=true make dist
|
2023-05-23 15:12:48 +00:00
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.build }}
|
|
|
|
path: release/
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
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@v3
|
2023-05-29 21:11:29 +00:00
|
|
|
with:
|
2023-05-23 15:12:48 +00:00
|
|
|
submodules: true
|
2023-08-23 23:18:58 +00:00
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
with:
|
|
|
|
go-version: '>=1.21.0'
|
2023-05-23 15:12:48 +00:00
|
|
|
- name: Build
|
|
|
|
id: build
|
|
|
|
env:
|
2023-05-29 21:11:29 +00:00
|
|
|
CMAKE_ARGS: "${{ matrix.defines }}"
|
2023-05-23 15:12:48 +00:00
|
|
|
BUILD_ID: "${{ matrix.build }}"
|
|
|
|
run: |
|
|
|
|
make dist
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.build }}
|
|
|
|
path: release/
|
|
|
|
- name: Release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
release/*
|