Skip to content

Build dependencies (Debug) #8

Build dependencies (Debug)

Build dependencies (Debug) #8

name: Build dependencies (Debug)
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
triplet: x64-windows
binary_ext: .dll
# - os: ubuntu-latest
# triplet: x64-linux
# binary_ext: .so
# - os: macos-latest
# triplet: x64-osx
# binary_ext: .dylib
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up vcpkg
uses: lukka/run-vcpkg@v11
with:
doNotCache: 'false'
vcpkgJsonGlob: '**/core/src/main/cpp/vcpkg.json'
- name: Configure CMake
shell: bash
run: |
cmake -S core/src/main/cpp -B build \
-DCMAKE_TOOLCHAIN_FILE=$GITHUB_WORKSPACE/vcpkg/scripts/buildsystems/vcpkg.cmake \
-DCMAKE_BUILD_TYPE=Debug
- name: Build native library
shell: bash
run: cmake --build build --config Debug
- name: Prepare resources
shell: bash
run: |
rm -rf core/src/main/resources/bin
mkdir -p core/src/main/resources/bin
cp build/*klarity${{ matrix.binary_ext }} core/src/main/resources/bin/ || true
for lib in avutil avcodec avformat swresample swscale portaudio; do
cp ${{ github.workspace }}/vcpkg/installed/${{ matrix.triplet }}/lib/*${lib}*${{ matrix.binary_ext }} core/src/main/resources/bin/ || true
done
- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Set up Gradle
uses: gradle/actions/setup-gradle@v4
- name: Build JARs
run: |
./gradlew :core:shadowJar
./gradlew :compose:shadowJar
./gradlew :example:shadowJar
- name: Clean up resources
run: |
rm -rf core/src/main/resources/bin
- name: Copy JARs
run: |
mkdir -p artifacts/${{ matrix.os }}
cp core/build/libs/*.jar artifacts/${{ matrix.os }}/core.jar
cp compose/build/libs/*.jar artifacts/${{ matrix.os }}/compose.jar
cp example/build/libs/*.jar artifacts/${{ matrix.os }}/example.jar
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: klarity-${{ matrix.os }}
path: artifacts/${{ matrix.os }}