Skip to content

Commit

Permalink
Install NDK if necessary in release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
valldrac committed Sep 1, 2024
1 parent 17a26a0 commit 716b6d2
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ permissions:
contents: read

env:
CARGO_TERM_COLOR: always
NDK_VERSION: '25.2.9519653'

jobs:
Expand All @@ -26,20 +25,27 @@ jobs:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git /opt/depot_tools
cd /opt/depot_tools
git checkout "$DEPOT_TOOLS_GIT_HASH^{commit}"
echo "/opt/depot_tools" >> "$GITHUB_PATH"
echo "/opt/depot_tools" >> $GITHUB_PATH
env:
DEPOT_TOOLS_GIT_HASH: 8ebbd5189d8a9df51ee3dad42dc04651620424bb

- uses: actions/checkout@v4

- run: |
git config --global user.name "build"
git config --global user.email "localhost"
- name: Free up disk space in runner
uses: ./.github/actions/disk-cleanup

- name: Install NDK
run: |
yes | "$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager" --install "ndk;$NDK_VERSION"
echo "ANDROID_NDK_HOME=$ANDROID_SDK_ROOT/ndk/$NDK_VERSION" >> $GITHUB_ENV
- name: Install Rust targets
run: rustup toolchain install $(cat rust-toolchain) --profile minimal --target aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android
run: |
rustup toolchain install $(cat rust-toolchain) --profile minimal --target aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android
- name: Set up JDK 17
uses: actions/setup-java@v4
Expand All @@ -53,22 +59,22 @@ jobs:
env:
DEPOT_TOOLS_UPDATE: 0

- name: Build library
run: ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VERSION" bin/build-aar --arch arm arm64 x64 --release-build
- name: Build library (AAR)
run: ./bin/build-aar --arch arm arm64 x64 --release-build
env:
OVERRIDE_VERSION: ${{ github.ref_name }}

- name: Log checksums
run: find out/release/libs -type f -exec sha256sum '{}' +

- name: Upload AARs
- name: Upload libs
uses: actions/upload-artifact@v4
with:
name: libs
path: out/release/libs/

- name: Publish to GitHub Packages
run: ANDROID_NDK_HOME="$ANDROID_HOME/ndk/$NDK_VERSION" ./bin/build-aar --arch arm arm64 x64 --release-build --publish
run: ./bin/build-aar --arch arm arm64 x64 --release-build --publish
env:
OVERRIDE_VERSION: ${{ github.ref_name }}
GITHUB_TOKEN: ${{ secrets.PUBLISH_PAT }}

0 comments on commit 716b6d2

Please sign in to comment.