-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Android release binaries to CI (#8601)
* Add Android release binaries to CI This commit is inspired by #6480 and historical asks for Android binaries. This does the bare minimum necessary to configure C compilers such that we can produce binaries but I'll admit that I'm no Android developer myself so I have no idea if these are actually suitable for use anywhere. Otherwise though this build subsumes the preexisting check in CI that the build works for Android, so that part is removed too. This additionally changes how the NDK is managed from before. Previously a GitHub Action was used to download Java and the NDK and additionally used the `cargo ndk` subcommand. That's all removed now in favor of configuring C compilers directly with a pre-installed version of the NDK which should help reduce the CI dependencies a bit. * Review comments * List Android as tier 3 target
- Loading branch information
1 parent
7d70319
commit d74b34f
Showing
5 changed files
with
54 additions
and
19 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# This is a small action which uses the pre-installed Android NDK on GitHub | ||
# Actions builders, configured with `$ANDROID_NDK`, to compile and link Android | ||
# code. For Rust we mostly need to configure the linker to Cargo and the C | ||
# compiler to the `cc` crate, so this sets various environment variables to the | ||
# appropriate tool within `$ANDROID_NDK`. | ||
|
||
name: 'Setup Rust to use the Android NDK' | ||
description: 'Setup Rust to use the android NDK' | ||
|
||
inputs: | ||
target: | ||
description: 'Rust target being used' | ||
required: true | ||
android-platform: | ||
description: 'Platform version to use for the C compiler' | ||
required: false | ||
default: '26' | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- run: | | ||
target=${{ inputs.target }} | ||
upcase=$(echo $target | tr a-z- A-Z_) | ||
ndk_bin=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin | ||
linker=$ndk_bin/${target}${{ inputs.android-platform }}-clang | ||
echo CARGO_TARGET_${upcase}_LINKER=$linker >> $GITHUB_ENV | ||
echo CC_${target}=$linker >> $GITHUB_ENV | ||
echo RANLIB_${target}=$ndk_bin/llvm-ranlib >> $GITHUB_ENV | ||
echo AR_${target}=$ndk_bin/llvm-ar >> $GITHUB_ENV | ||
shell: bash |
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
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
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
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