Build Libs #2
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: Build Libs | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
paths: | |
- 'Platform/**' | |
- '!Platform/libs/**' | |
pull_request: | |
paths: | |
- 'Platform/**' | |
- '!Platform/libs/**' | |
jobs: | |
Build: | |
strategy: | |
matrix: | |
include: | |
- os: windows-latest | |
lib: x64/FosterAudioPlatform.dll | |
- os: macos-latest | |
lib: osx/libFosterAudioPlatform.dylib | |
- os: ubuntu-latest | |
lib: lib64/libFosterAudioPlatform.so | |
runs-on: ${{matrix.os}} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.0.0 | |
- name: Get CMake | |
uses: lukka/get-cmake@v3.27.4 | |
- name: Setup Linux dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install libsdl2-dev | |
- name: CMake Configure | |
run: cmake -B build -S Platform | |
- name: CMake Build | |
run: cmake --build build --config Release | |
- name: Publish Artifact | |
uses: actions/upload-artifact@v3.1.3 | |
with: | |
name: ${{matrix.os}}-build | |
path: Platform/libs/${{matrix.lib}} | |
UpdateLibs: | |
if: github.ref == 'refs/heads/main' | |
needs: [Build] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.0.0 | |
- name: Download windows lib | |
uses: actions/download-artifact@v3 | |
with: | |
name: windows-latest-build | |
path: Platform/libs/x64 | |
- name: Download macos lib | |
uses: actions/download-artifact@v3 | |
with: | |
name: macos-latest-build | |
path: Platform/libs/osx | |
- name: Download ubuntu lib | |
uses: actions/download-artifact@v3 | |
with: | |
name: ubuntu-latest-build | |
path: Platform/libs/lib64 | |
- name: Display structure of libs | |
run: ls -R | |
working-directory: Platform/libs | |
- name: Commit changes | |
uses: EndBug/add-and-commit@v9.1.3 | |
with: | |
message: Updated platform libs | |
committer_name: GitHub Actions | |
committer_email: actions@github.com |