Update build.gradle #45
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
on: push | |
jobs: | |
rust-build: | |
name: Build ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-latest] | |
include: | |
- os: windows-latest | |
lib: engine_java.dll | |
# - os: macos-latest | |
# lib: libengine_java.dylib | |
- os: ubuntu-latest | |
lib: libengine_java.so | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Install LLVM and Clang | |
uses: KyleMayes/install-llvm-action@v1 | |
with: | |
version: '11' | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- name: Cargo Build | |
working-directory: ./java | |
run: cargo build --release --features=java | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: java-${{ matrix.os }} | |
path: ./target/release/${{ matrix.lib }} | |
java-build: | |
name: Build Java | |
needs: rust-build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
- name: Download Build Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
path: ./java/lib/src/main/resources | |
merge-multiple: true | |
- name: Gradlew Build | |
working-directory: ./java | |
run: ./gradlew build | |
- name: Upload Build Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: java | |
path: ./java/lib/build/libs |