Improve the workflow for Windows build #176
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}} | |
- 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] | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: download | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Create release package | |
run: cd artifacts/darwin-build/ && zip release-darwin-arm64.zip | |
llm | |
libllm.dylib | |
libllmplugincublas.dylib | |
libllmpluginffmpeg.dylib | |
- name: create-release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
${{github.workspace}}/build/release-darwin-arm64.zip |