From 457db333d984863f9eae6ca624c03d7bd52ee96e Mon Sep 17 00:00:00 2001 From: Ardocrat Date: Sat, 3 Aug 2024 18:12:06 +0000 Subject: [PATCH 1/3] build: fix android github --- .github/workflows/release.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 85ff2f6..0436d10 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,6 +63,7 @@ jobs: working-directory: android run: | rm -rf app/build + rm -rf app/src/main/jniLibs/* ./gradlew assembleRelease mv app/build/outputs/apk/release/app-release.apk grim-${{ github.ref_name }}-android-armv7.apk - name: Checksum APK ARMv7 @@ -82,6 +83,7 @@ jobs: working-directory: android run: | rm -rf app/build + rm -rf app/src/main/jniLibs/* ./gradlew assembleRelease mv app/build/outputs/apk/release/app-release.apk grim-${{ github.ref_name }}-android-x86_64.apk - name: Checksum APK x86 From 36168442a920c79f5258bb0de35c067aec85cfc2 Mon Sep 17 00:00:00 2001 From: Ardocrat Date: Sun, 4 Aug 2024 08:57:10 +0000 Subject: [PATCH 2/3] github: build on push --- .github/workflows/build.yml | 59 +++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..68cc336 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +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 From 0c1e279215c10652a2f7f7b6c3ca5edce0c544bd Mon Sep 17 00:00:00 2001 From: Ardocrat Date: Sun, 4 Aug 2024 09:30:00 +0000 Subject: [PATCH 3/3] github: fix android build --- .github/workflows/build.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 68cc336..f199f0b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,12 @@ jobs: rustup target add aarch64-linux-android rustup target add armv7-linux-androideabi rustup target add x86_64-linux-android + - name: Setup Java build + run: | + chmod +x android/gradlew + echo "${{ secrets.ANDROID_RELEASE_KEYSTORE }}" > release.keystore.asc + gpg -d --passphrase "${{ secrets.ANDROID_RELEASE_SECRET }}" --batch release.keystore.asc > android/keystore + echo -e "storePassword=${{ secrets.ANDROID_PASS }}\nkeyPassword=${{ secrets.ANDROID_PASS }}\nkeyAlias=grim\nstoreFile=../keystore" > android/keystore.properties - name: Build lib 1/2 continue-on-error: true run: | @@ -31,8 +37,7 @@ jobs: - name: Build APK working-directory: android run: | - chmod +x gradlew - ./gradlew assembleDebug + ./gradlew assembleRelease linux: name: Linux Build