-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Kotlin CI #45
Merged
feat: Kotlin CI #45
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
7c1b25c
Build binaries without UDL file
jakubuid 5339f20
Generate bindings out of promacros
jakubuid ae1a095
Clean up
jakubuid 38bd24d
Add cli feature to uniffi
jakubuid e8ae419
Clean up
jakubuid d8f21b7
chore: test building w/o all features (#43)
chris13524 cdcfcdd
Update crates/yttrium/src/lib.rs
jakubuid 92670ff
Update crates/yttrium/src/account_client.rs
jakubuid 846f63c
Update crates/yttrium/src/config.rs
jakubuid 4ca465c
Update crates/yttrium/src/config.rs
jakubuid 5969775
Update crates/yttrium/src/config.rs
jakubuid 9a0f061
fix: CI check
a127e7f
fix: build
6fa5b11
Formatting
jakubuid 131779b
Add kotlin release workflow
jakubuid 5eae316
Add trigger for tests
jakubuid 8c9f1d7
Update
jakubuid 172809f
Fix invalid file
jakubuid 895a81a
Merge branch 'main' of https://github.com/WalletConnect/yttrium into …
jakubuid 88c8987
Update action version
jakubuid 30a5ead
Change action for Android
jakubuid d749f23
Update java versions
jakubuid 5352689
Set up java first
jakubuid b606a14
Install cargo ndk
jakubuid 2b54672
Update
jakubuid 579fc18
Fix path to binary when generating bindings
jakubuid 6cf77a0
Fix artifacts paths
jakubuid 42e3c62
Create a separate job for a release
jakubuid 81826bd
Change job names
jakubuid 34abefb
FIX FILE
jakubuid 870c567
Remove wildcart
jakubuid 059306e
Change asset name
jakubuid b970c25
Remove package name
jakubuid 8fc3316
Update targets
jakubuid d64fdc7
Retert targets
jakubuid 95a62a9
Update dir structure
jakubuid 9ebac07
Fix creating zip
jakubuid 77305e2
Use workflow dispatch
jakubuid File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Build and Release Yttrium Kotlin | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Version to release (e.g. 0.0.1)' | ||
required: true | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
VERSION: ${{ github.event.inputs.version || '0.0.24' }} | ||
TARGET_BRANCH: ${{ github.ref_name }} | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build-kotlin-artifacts: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
target: [aarch64-linux-android, armv7-linux-androideabi] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
target: ${{ matrix.target }} | ||
override: true | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Set up Android SDK | ||
uses: android-actions/setup-android@v3 | ||
with: | ||
api-level: 35 | ||
build-tools: 35.0.0 | ||
ndk-version: 27.2.12479018 | ||
|
||
- name: Install cargo-ndk | ||
run: | | ||
cargo install cargo-ndk | ||
- name: Build Rust library | ||
run: | | ||
cargo ndk -t ${{ matrix.target }} build --release --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 }}/release/libuniffi_yttrium.so --language kotlin --out-dir yttrium/kotlin-bindings | ||
- name: Prepare artifacts | ||
run: | | ||
# Map Rust targets to Android ABI names | ||
declare -A abi_map | ||
abi_map[aarch64-linux-android]="arm64-v8a" | ||
abi_map[armv7-linux-androideabi]="armeabi-v7a" | ||
abi_name=${abi_map[${{ matrix.target }}]} | ||
if [ -z "$abi_name" ]; then | ||
echo "Unknown ABI for target ${{ matrix.target }}" | ||
exit 1 | ||
fi | ||
mkdir -p yttrium/libs/$abi_name | ||
cp target/${{ matrix.target }}/release/libuniffi_yttrium.so yttrium/libs/$abi_name/ | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: yttrium/ | ||
|
||
release-kotlin-artifacts: | ||
needs: build-kotlin-artifacts | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: artifacts | ||
path: yttrium/ | ||
|
||
- name: Create artifacts zip | ||
run: | | ||
zip -r kotlin-artifacts.zip yttrium/ | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ env.VERSION }} | ||
release_name: Yttrium ${{ env.VERSION }} | ||
draft: false | ||
prerelease: true | ||
|
||
- name: Upload Release Assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: kotlin-artifacts.zip | ||
asset_name: kotlin-artifacts.zip | ||
asset_content_type: application/zip |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
[bindings.kotlin] | ||
package_name = "com.reown.kotlin.ffi.yttrium" | ||
android = true | ||
android_cleaner = true |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2 jobs instead of 1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it targets two android architectures built on two jobs and we want to create a one release when these two jobs are finished