grim/.github/workflows/build.yml
2024-08-04 08:57:10 +00:00

59 lines
1.7 KiB
YAML

name: Build
on: [push, pull_request]
jobs:
android:
name: Android Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup build
run: |
cargo install cargo-ndk
rustup target add aarch64-linux-android
rustup target add armv7-linux-androideabi
rustup target add x86_64-linux-android
- name: Build lib 1/2
continue-on-error: true
run: |
sed -i -e 's/"rlib"/"cdylib","rlib"/g' Cargo.toml
export CPPFLAGS="-DMDB_USE_ROBUST=0" && export CFLAGS="-DMDB_USE_ROBUST=0" && cargo ndk -t arm64-v8a build --profile release-apk
- name: Build lib 2/2
run: |
unset CPPFLAGS && unset CFLAGS && cargo ndk -t arm64-v8a -o android/app/src/main/jniLibs build --profile release-apk
sed -i -e 's/"cdylib","rlib"/"rlib"/g' Cargo.toml
- name: Build APK
working-directory: android
run: |
chmod +x gradlew
./gradlew assembleDebug
linux:
name: Linux Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Release build
run: cargo build --release
windows:
name: Windows Build
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Release build
run: cargo build --release
macos:
name: MacOS Build
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Release build
run: cargo build --release