Skip to content

Improve the workflow for Windows build #177

Improve the workflow for Windows build

Improve the workflow for Windows build #177

Workflow file for this run

name: macOS
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: macos-14
steps:
- name: Install Go
uses: actions/[email protected]
with:
go-version: '1.22.5'
- run: go version
- uses: actions/checkout@v3
- name: Install OpenMP
run: |
brew install libomp
ls $(brew --prefix)/opt/libomp
- name: Build ffmpeg
run: |
cd third_party
bash install_ffmpeg.sh
rm ffmpeg/version
- name: Configure CMake
run: OpenMP_ROOT=$(brew --prefix)/opt/libomp cmake
-B ${{github.workspace}}/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DWITH_FFMPEG=ON
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Copy dependencies
run: cp $(brew --prefix)/opt/libomp/lib/libomp.dylib ${{github.workspace}}\build
- run: install_name_tool
-change "$(brew --prefix)/opt/libomp/lib/libomp.dylib"
'@loader_path/libomp.dylib'
${{github.workspace}}\build\libllm.dylib
- uses: actions/upload-artifact@v4
with:
name: darwin-build
path: ${{github.workspace}}/build
- name: Test
run: ctest --verbose -C ${{env.BUILD_TYPE}} --test-dir ${{github.workspace}}/build/src/libllm
release:
permissions:
contents: write # for softprops/action-gh-release to create a release
needs: [build]
runs-on: ubuntu-latest
steps:
- name: download
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Create release package
run: tar -cvzf release-darwin-arm64.tar.gz
artifacts/darwin-build/llm
artifacts/darwin-build/libllm.dylib
artifacts/darwin-build/libllmplugincublas.dylib
artifacts/darwin-build/libllmpluginffmpeg.dylib
artifacts/darwin-build/libomp.dylib
- name: create-release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{github.workspace}}/build/release-darwin-arm64.zip