Build library (kotlin-android) #4
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 library (kotlin-android) | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build kotlin bindings for android | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.SSH_KEY }} | |
submodules: recursive | |
ref: build/kotlin-android | |
- name: Install rust | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | |
- uses: de-vri-es/setup-git-credentials@v2 | |
with: | |
credentials: ${{ secrets.WORFKLOW_TOKEN_LIBRARIES }} | |
- name: Install targets | |
run: | | |
cargo install cargo-ndk | |
rustup target add arm-linux-androideabi | |
rustup target add aarch64-linux-android | |
rustup target add armv7-linux-androideabi | |
rustup target add i686-linux-android | |
rustup target add x86_64-linux-android | |
rustup target add x86_64-unknown-linux-gnu | |
- name: Cache rust modules | |
id: cache-rust | |
uses: actions/cache@v3 | |
env: | |
cache-name: cache-rust-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: target | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
- name: Build kotlin bindings | |
run: | | |
bash kotlin-android-build.sh | |
- name: Save kotlin artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: kotlin-bindings-android | |
path: | | |
bindings/kotlin |