diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index e3e97d0f..2cd1f45b 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -273,48 +273,18 @@ jobs: asset_name: chain-wallet-libs-${{ needs.initial_release.outputs.version }}-${{ matrix.target }} asset_content_type: application/gzip - build_jni_assets: - name: Build android jni wallet ${{ matrix.config.os }} - needs: initial_release - runs-on: ${{ matrix.config.os }} + build_uniffi: + name: Build uniffi jni shared libs for android with cross + runs-on: ubuntu-latest strategy: - fail-fast: false matrix: config: - # Android - - { - os: ubuntu-latest, - cross: true, - toolchain: stable, - target: aarch64-linux-android, - } - - { - os: ubuntu-latest, - cross: true, - toolchain: stable, - target: armv7-linux-androideabi, - } - - { - os: ubuntu-latest, - cross: true, - toolchain: stable, - target: i686-linux-android, - } - - { - os: ubuntu-latest, - cross: true, - toolchain: stable, - target: x86_64-linux-android, - } + - { target: aarch64-linux-android } + - { target: armv7-linux-androideabi } + - { target: i686-linux-android } + - { target: x86_64-linux-android } steps: - - uses: actions-rs/toolchain@v1 - with: - toolchain: ${{ matrix.config.toolchain }} - target: ${{ matrix.config.target }} - override: true - default: true - - name: Checkout code uses: actions/checkout@v1 with: @@ -323,59 +293,21 @@ jobs: - name: Build library (release) uses: actions-rs/cargo@v1 with: - use-cross: ${{ matrix.config.cross }} + use-cross: true command: rustc - args: --release --target ${{ matrix.config.target }} -p wallet-jni -- -C lto -C link-args=-ldl + args: --release --target ${{ matrix.config.target }} -p wallet-uniffi --features builtin-bindgen -- -C link-args=-ldl - name: Prepare package run: mkdir -p jniLibs/${{ matrix.config.target }} - name: copy binary - run: cp ./target/${{ matrix.config.target }}/release/libwallet_jni.so ./jniLibs/${{ matrix.config.target }}/; + run: cp ./target/${{ matrix.config.target }}/release/libuniffi_jormungandr_wallet.so ./jniLibs/${{ matrix.config.target }}/; - - uses: actions/upload-artifact@v1 + - uses: actions/upload-artifact@v2 with: name: jniLibs path: ./jniLibs - - package_android_module: - runs-on: ubuntu-latest - needs: [build_jni_assets, initial_release] - - steps: - - name: Checkout code - uses: actions/checkout@v1 - with: - submodules: true - - - name: Download builded libs - uses: actions/download-artifact@v1 - with: - name: jniLibs - - - name: Copy libs - run: cp -r jniLibs bindings/wallet-android/src/main/ - - - name: Rename jni folders - working-directory: ./bindings/wallet-android/src/main/jniLibs - run: python3 ./rename_targets.py - - - name: Compress module - run: | - tar \ - -czvf \ - chain-wallet-libs-android-${{ needs.initial_release.outputs.version }}.tar.gz \ - ./bindings/wallet-android/* - - - name: Upload binaries to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.initial_release.outputs.upload_url }} - asset_path: chain-wallet-libs-android-${{ needs.initial_release.outputs.version }}.tar.gz - asset_name: chain-wallet-libs-android-${{ needs.initial_release.outputs.version }} - asset_content_type: application/gzip + retention-days: 1 build_lipo_asset: name: Build universal lib for cordova plugin @@ -409,7 +341,7 @@ jobs: package_cordova_plugin: runs-on: ubuntu-latest - needs: [build_jni_assets, build_lipo_asset, initial_release] + needs: [build_uniffi, build_lipo_asset, initial_release] steps: - name: Checkout code @@ -417,7 +349,7 @@ jobs: with: submodules: true - - name: Download builded libs + - name: Download jni libs uses: actions/download-artifact@v1 with: name: jniLibs