Skip to content

Commit

Permalink
Update kotlin release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubuid committed Jan 15, 2025
1 parent 59f3665 commit 4a54f1a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/release-kotlin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,17 @@ jobs:
- name: Build Rust library
run: |
cargo ndk -t ${{ matrix.target }} build --profile=uniffi-release --features=uniffi/cli
cargo ndk -t ${{ matrix.target }} build --profile=uniffi-release-next --features=uniffi/cli
- name: Generate Kotlin bindings (once)
if: ${{ matrix.target == 'aarch64-linux-android' }}
run: |
cargo run --features=uniffi/cli --bin uniffi-bindgen generate --library target/${{ matrix.target }}/uniffi-release/libuniffi_yttrium.so --language kotlin --out-dir yttrium/kotlin-bindings
cargo run --features=uniffi/cli --bin uniffi-bindgen generate --library target/${{ matrix.target }}/uniffi-release-next/libuniffi_yttrium.so --language kotlin --out-dir yttrium/kotlin-bindings
- name: Strip binaries
run: |
NDK_PATH=$HOME/Library/Android/sdk/ndk/27.2.12479018
$NDK_PATH/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip target/${{ matrix.target }}/uniffi-release-next/libuniffi_yttrium.so
- name: Prepare artifacts
run: |
Expand Down
4 changes: 2 additions & 2 deletions .jitpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ before_install:
- mkdir -p crates/kotlin-ffi/android/src/main/jniLibs/armeabi-v7a
- mkdir -p crates/kotlin-ffi/android/src/main/kotlin/com/reown/yttrium
- echo "Moving binaries and bindings"
- mv binaries/yttrium/libs/arm64-v8a/libuniffi_yttrium.so crates/kotlin-ffi/android/src/main/jniLibs/arm64-v8a/ || echo "Failed to move arm64-v8a .so"
- mv binaries/yttrium/libs/armeabi-v7a/libuniffi_yttrium.so crates/kotlin-ffi/android/src/main/jniLibs/armeabi-v7a/ || echo "Failed to move armeabi-v7a .so"
- mv binaries/yttrium/libs/arm64-v8a/libuniffi_yttrium.so crates/kotlin-ffi/android/src/main/jniLibs/arm64-v8a/ || echo "Failed to move arm64-v8a.so"
- mv binaries/yttrium/libs/armeabi-v7a/libuniffi_yttrium.so crates/kotlin-ffi/android/src/main/jniLibs/armeabi-v7a/ || echo "Failed to move armeabi-v7a.so"
- mv binaries/yttrium/kotlin-bindings/uniffi/uniffi_yttrium/uniffi_yttrium.kt crates/kotlin-ffi/android/src/main/kotlin/com/reown/yttrium/ || echo "Failed to move uniffi_yttrium.kt"
- mv binaries/yttrium/kotlin-bindings/uniffi/yttrium/yttrium.kt crates/kotlin-ffi/android/src/main/kotlin/com/reown/yttrium/ || echo "Failed to move yttrium.kt"
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ codegen-units = 1

# What we should aim for short-term
[profile.uniffi-release-next]
inherits = "profile7"
inherits = "profile8"
# profile7-nightly-stdopt

[profile.uniffi-release-iter1]
Expand Down
3 changes: 3 additions & 0 deletions generate_kotlin_locally.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ mv target/armv7-linux-androideabi/uniffi-release-next/libuniffi_yttrium.so crate
mv yttrium/kotlin-bindings/uniffi/uniffi_yttrium/uniffi_yttrium.kt crates/kotlin-ffi/android/src/main/kotlin/com/reown/yttrium/
mv yttrium/kotlin-bindings/uniffi/yttrium/yttrium.kt crates/kotlin-ffi/android/src/main/kotlin/com/reown/yttrium/

$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip crates/kotlin-ffi/android/src/main/jniLibs/arm64-v8a/libuniffi_yttrium.so
$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/darwin-x86_64/bin/llvm-strip crates/kotlin-ffi/android/src/main/jniLibs/armeabi-v7a/libuniffi_yttrium.so

gradle clean assembleRelease publishToMavenLocal

0 comments on commit 4a54f1a

Please sign in to comment.