Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed May 12, 2024
1 parent 576e7de commit 8cd68b0
Showing 1 changed file with 30 additions and 17 deletions.
47 changes: 30 additions & 17 deletions .github/actions/android-ndk/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,39 @@ inputs:
android-target:
description: 'Android target to activate'
required: true
android-platform:
description: 'SOMETHING'
required: false
default: '26'

runs:
using: composite
steps:
- run: find $ANDROID_NDK
shell: bash
- name: Set Up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/cargo-ndk
key: cargo-ndk-bin-${{ inputs.cargo-ndk }}
- run: echo "${{ runner.tool_cache }}/cargo-ndk/bin" >> $GITHUB_PATH
shell: bash
- run: cargo install --root ${{ runner.tool_cache }}/cargo-ndk --version ${{ inputs.cargo-ndk }} cargo-ndk --locked
shell: bash
- run: cargo ndk-env -t ${{ inputs.android-target }} --json | jq -r 'to_entries[] | [.key, .value] | @tsv' | sed 's/\t/=/' | grep -v LINKER >> $GITHUB_ENV
shell: bash
- run: |
rust=$CARGO_BUILD_TARGET
which=$ANDROID_NDK/ndk-which
upcase=$(echo $rust | awk '{ print toupper($0) }' | sed 's/-/_/g')
linker=`$which ${rust}${{ inputs.android-platform }}-clang`
echo CARGO_TARGET_${upcase}_LINKER=$linker >> $GITHUB_ENV
echo CC_${rust}=$linker >> $GITHUB_ENV
echo RANLIB_${rust}=`which llvm-ranlib` >> $GITHUB_ENV
echo AR_${rust}=`which llvm-ar` >> $GITHUB_ENV
# - name: Set Up JDK 17
# uses: actions/setup-java@v4
# with:
# java-version: '17'
# distribution: 'temurin'
# - name: Setup Android SDK
# uses: android-actions/setup-android@v3
# - uses: actions/cache@v4
# with:
# path: ${{ runner.tool_cache }}/cargo-ndk
# key: cargo-ndk-bin-${{ inputs.cargo-ndk }}
# - run: echo "${{ runner.tool_cache }}/cargo-ndk/bin" >> $GITHUB_PATH
# shell: bash
# - run: cargo install --root ${{ runner.tool_cache }}/cargo-ndk --version ${{ inputs.cargo-ndk }} cargo-ndk --locked
# shell: bash
# - run: cargo ndk-env -t ${{ inputs.android-target }} --json | jq -r 'to_entries[] | [.key, .value] | @tsv' | sed 's/\t/=/' | grep -v LINKER >> $GITHUB_ENV
# shell: bash

0 comments on commit 8cd68b0

Please sign in to comment.