diff --git a/.github/workflows/release-kotlin-bindings.yml b/.github/workflows/release-kotlin-bindings.yml index eef16f3ec..a945c3c84 100644 --- a/.github/workflows/release-kotlin-bindings.yml +++ b/.github/workflows/release-kotlin-bindings.yml @@ -60,12 +60,29 @@ jobs: use-cross: true command: build args: --release --target ${{ matrix.target }} --manifest-path bindings_ffi/Cargo.toml --target-dir bindings_ffi/target + - name: Upload binary uses: actions/upload-artifact@v3 with: - name: ${{ matrix.output_target }} - path: bindings_ffi/target/${{ matrix.output_target }}/release/libxmtpv3.so + name: ${{ matrix.target }} + path: bindings_ffi/target/${{ matrix.target }}/release/libxmtpv3.so retention-days: 1 + + - name: Prepare JNI libs + run: | + LIBRARY_NAME="libxmtpv3" + TARGET_NAME="libuniffi_xmtpv3" + cd bindings_ffi + rm -rf jniLibs/ + mkdir -p jniLibs/armeabi-v7a/ && \ + cp target/armv7-linux-androideabi/release/$LIBRARY_NAME.so jniLibs/armeabi-v7a/$TARGET_NAME.so && \ + mkdir -p jniLibs/x86/ && \ + cp target/i686-linux-android/release/$LIBRARY_NAME.so jniLibs/x86/$TARGET_NAME.so && \ + mkdir -p jniLibs/x86_64/ && \ + cp target/x86_64-linux-android/release/$LIBRARY_NAME.so jniLibs/x86_64/$TARGET_NAME.so && \ + mkdir -p jniLibs/arm64-v8a/ && \ + cp target/aarch64-linux-android/release/$LIBRARY_NAME.so jniLibs/arm64-v8a/$TARGET_NAME.so + package-kotlin: needs: [build-linux] @@ -77,12 +94,12 @@ jobs: - name: Download artifacts uses: actions/download-artifact@v3 with: - path: bindings_ffi/target + path: bindings_ffi/jniLibs - name: Build archive working-directory: bindings_ffi run: | - zip -r LibXMTPKotlinFFI.zip target + zip -r LibXMTPKotlinFFI.zip jniLibs - name: Get short SHA id: slug