Skip to content

Build Abi for Android #5

Build Abi for Android

Build Abi for Android #5

Workflow file for this run

name: Build Abi for Android
on:
workflow_dispatch:
inputs:
target:
required: true
default: aarch64-linux-android
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./rust
steps:
- name: Checkout code
uses: actions/checkout@v2
# Set up Android NDK and Cargo toolchain for cross-compiling to Android
- name: Set up environment
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ github.event.inputs.target }}
# Download Android NDK for cross-compiling
- name: Download Android NDK
uses: nttld/[email protected]
with:
# Exact version to use
ndk-version: r26d
local-cache: true
# Install Cargo target for Android
- name: Install cargo target for Android
run: |
mkdir output
cargo ndk -o ./output -t ${{ github.event.inputs.target }} --manifest-path ./Cargo.toml build --release
ls ./output
tar -czvf ${{ github.event.inputs.target }}.tar.gz ./output
# Upload the built artifacts as an artifact
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: android-release
path: rust/${{ github.event.inputs.target }}.tar.gz