[DEVOPS-1333] Add code signing to the macOS bws CLI #2660
Workflow file for this run
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
--- | |
name: Build Android | |
on: | |
pull_request: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-22.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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable | |
with: | |
toolchain: 1.67.0 # https://github.com/cross-rs/cross/issues/1222 | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
with: | |
key: ${{ matrix.settings.target }}-cargo | |
- name: Install Cross | |
run: cargo install cross --locked | |
- 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@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6 # v4.2.0 | |
with: | |
name: android-${{ matrix.settings.target }} | |
path: ./target/${{ matrix.settings.target }}/release/libbitwarden_uniffi.so | |
if-no-files-found: error | |
combine: | |
runs-on: ubuntu-22.04 | |
needs: build | |
steps: | |
- name: Checkout repo (PR) | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
if: github.event_name == 'pull_request' | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
- name: Checkout repo (Push) | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
if: github.event_name == 'push' | |
with: | |
fetch-depth: 0 | |
- name: Install rust | |
uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 # stable | |
with: | |
toolchain: stable | |
- name: Cache cargo registry | |
uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3 | |
with: | |
key: cargo-combine-cache | |
- name: Setup Java | |
uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 | |
with: | |
distribution: temurin | |
java-version: 17 | |
- name: Download Artifacts | |
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1 | |
- name: Move artifacts | |
working-directory: languages/kotlin/sdk/src/main/jniLibs | |
run: | | |
mkdir armeabi-v7a arm64-v8a x86 x86_64 | |
mv /home/runner/work/sdk/sdk/android-armv7-linux-androideabi/libbitwarden_uniffi.so ./armeabi-v7a/libbitwarden_uniffi.so | |
mv /home/runner/work/sdk/sdk/android-aarch64-linux-android/libbitwarden_uniffi.so ./arm64-v8a/libbitwarden_uniffi.so | |
mv /home/runner/work/sdk/sdk/android-i686-linux-android/libbitwarden_uniffi.so ./x86/libbitwarden_uniffi.so | |
mv /home/runner/work/sdk/sdk/android-x86_64-linux-android/libbitwarden_uniffi.so ./x86_64/libbitwarden_uniffi.so | |
- name: Generate bindings | |
working-directory: languages/kotlin | |
run: ./build-schemas.sh | |
- name: Publish | |
uses: gradle/gradle-build-action@982da8e78c05368c70dac0351bb82647a9e9a5d2 # v2.11.1 | |
with: | |
arguments: sdk:publish | |
build-root-directory: languages/kotlin | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |