ci: add and use uniffi-bindgen-ubuntu reusable workflow
#1
Workflow file for this run
This file contains hidden or 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
| concurrency: | ||
|
Check failure on line 1 in .github/workflows/build-android.yml
|
||
| group: "${{ github.workflow }}-${{ github.ref }}-build-android" | ||
| cancel-in-progress: true | ||
| on: | ||
| workflow_call: | ||
| env: | ||
| ANDROID_NDK_VERSION: 28.1.13356709 | ||
| CARGO_TERM_COLOR: always | ||
| CARGO_NET_GIT_FETCH_WITH_CLI: true | ||
| CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | ||
| RELEASE: 1 | ||
| jobs: | ||
| build-android: | ||
| if: github.repository == 'wireapp/core-crypto' | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - task: android-armv7 | ||
| target: armv7-linux-androideabi | ||
| - task: android-armv8 | ||
| target: aarch64-linux-android | ||
| - task: android-x86 | ||
| target: x86_64-linux-android | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: ./.github/actions/setup-and-cache-rust | ||
| with: | ||
| target: ${{ matrix.target }} | ||
| - name: setup android sdk | ||
| uses: android-actions/setup-android@v3 | ||
| - name: install ndk | ||
| run: echo "y" | sdkmanager --install "ndk;$ANDROID_NDK_VERSION" | ||
| - name: build android package | ||
| env: | ||
| ANDROID_NDK_HOME: /usr/local/lib/android/sdk/ndk/${{ env.ANDROID_NDK_VERSION}} | ||
| run: | | ||
| make ${{ matrix.task }} | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: android-target-${{ matrix.target }} | ||
| path: target/${{ matrix.target }}/release/libcore_crypto_ffi.* | ||
| retention-days: 1 | ||
| ffi-library: | ||
| if: github.repository == 'wireapp/core-crypto' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: ./.github/actions/setup-and-cache-rust | ||
| - run: make ffi-library | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ffi-library | ||
| path: target/release/libcore_crypto_ffi.so | ||
| retention-days: 1 | ||
| package-android: | ||
| if: github.repository == 'wireapp/core-crypto' | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - build-android | ||
| - ffi-library | ||
| steps: | ||
| - uses: actions/checkout@v5 | ||
| - uses: ./.github/actions/setup-and-cache-rust | ||
| - name: set up jdk 17 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: "17" | ||
| distribution: "adopt" | ||
| - name: gradle setup | ||
| uses: gradle/actions/setup-gradle@v4 | ||
| - name: validate gradle wrapper | ||
| uses: gradle/actions/wrapper-validation@v4 | ||
| - name: setup android sdk | ||
| uses: android-actions/setup-android@v3 | ||
| - name: install ndk | ||
| run: echo "y" | sdkmanager --install "ndk;$ANDROID_NDK_VERSION" | ||
| - name: download armv7-linux-androideabi binaries | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: android-target-armv7-linux-androideabi | ||
| path: target/armv7-linux-androideabi/release | ||
| - name: download aarch64-linux-android binaries | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: android-target-aarch64-linux-android | ||
| path: target/aarch64-linux-android/release | ||
| - name: download x86_64-linux-android binaries | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: android-target-x86_64-linux-android | ||
| path: target/x86_64-linux-android/release | ||
| - name: download ffi-library | ||
| uses: actions/download-artifact@v5 | ||
| with: | ||
| name: ffi-library | ||
| path: target/release/ | ||
| - name: fetch or make uniffi-bindgen | ||
| - uses: ./.github/workflows/uniffi-bindgen-ubuntu.yml | ||
| - run: make android | ||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: android | ||
| path: | | ||
| crypto-ffi/bindings | ||
| target/*android* | ||
| retention-days: 1 | ||