Skip to content

[PM-8618] Credential Exchange #289

[PM-8618] Credential Exchange

[PM-8618] Credential Exchange #289

Workflow file for this run

name: Build Android
on:
pull_request:
push:
branches:
- "main"
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
name: Build
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
settings:
- target: aarch64-linux-android
- target: armv7-linux-androideabi
- target: x86_64-linux-android
- target: i686-linux-android
steps:
- name: Checkout repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install rust
uses: dtolnay/rust-toolchain@315e265cd78dad1e1dcf3a5074f6d6c47029d5aa # stable
with:
toolchain: stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
key: ${{ matrix.settings.target }}-cargo
- name: Install Cross
run: cargo install cross --locked --git https://github.com/cross-rs/cross.git --rev 185398b1b885820515a212de720a306b08e2c8c9
- name: Build
env:
TARGET: ${{ matrix.settings.target }}
run: cross build -p bitwarden-uniffi --release --target=${{ matrix.settings.target }}
- name: Upload artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: android-${{ matrix.settings.target }}
path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.so
if-no-files-found: error
combine:
name: Combine
runs-on: ubuntu-24.04
needs: build
steps:
- name: Checkout repo (PR)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
- name: Checkout repo (Push)
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
if: github.event_name == 'push'
with:
fetch-depth: 0
- name: Install rust
uses: dtolnay/rust-toolchain@315e265cd78dad1e1dcf3a5074f6d6c47029d5aa # stable
with:
toolchain: stable
- name: Cache cargo registry
uses: Swatinem/rust-cache@82a92a6e8fbeee089604da2575dc567ae9ddeaab # v2.7.5
with:
key: cargo-combine-cache
- name: Setup Java
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: temurin
java-version: 17
- name: Download Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
- name: Move artifacts
working-directory: crates/bitwarden-uniffi/kotlin/sdk/src/main/jniLibs
run: |
mkdir armeabi-v7a arm64-v8a x86 x86_64
mv /home/runner/work/sdk-internal/sdk-internal/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./armeabi-v7a/libbitwarden_uniffi.so
mv /home/runner/work/sdk-internal/sdk-internal/android-aarch64-linux-android/libbitwarden_uniffi.so ./arm64-v8a/libbitwarden_uniffi.so
mv /home/runner/work/sdk-internal/sdk-internal/android-i686-linux-android/libbitwarden_uniffi.so ./x86/libbitwarden_uniffi.so
mv /home/runner/work/sdk-internal/sdk-internal/android-x86_64-linux-android/libbitwarden_uniffi.so ./x86_64/libbitwarden_uniffi.so
- name: Generate bindings
working-directory: crates/bitwarden-uniffi/kotlin
run: ./build-schemas.sh
- name: Setup gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
- name: Publish
run: ./gradlew sdk:publish
working-directory: crates/bitwarden-uniffi/kotlin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}