Skip to content

Commit

Permalink
fix: ndk ordering and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zaneschepke committed Jan 6, 2025
1 parent 3b92156 commit 9144e1e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 5 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/build-nym-vpn-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,18 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Android SDK
- name: Setup NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
add-to-path: false

- name: Set env
shell: bash
run: |
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
echo "NDK_TOOLCHAIN_DIR=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-nym-vpn-core-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,18 @@ jobs:
run: |
rustup target install aarch64-linux-android
- name: Setup Android SDK
- name: Setup NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
add-to-path: false

- name: Set env
shell: bash
run: |
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
echo "NDK_TOOLCHAIN_DIR=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_ENV
- name: Install cargo deps
run: |
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/publish-nym-vpn-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,18 @@ jobs:
- name: Setup Android SDK
uses: android-actions/setup-android@v3

- name: Setup Android SDK
- name: Setup NDK
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
link-to-sdk: true
add-to-path: false

- name: Set env
shell: bash
run: |
echo "ANDROID_NDK_HOME=${{ steps.setup-ndk.outputs.ndk-path }}" >> $GITHUB_ENV
echo "NDK_TOOLCHAIN_DIR=${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_ENV
- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
7 changes: 6 additions & 1 deletion nym-vpn-android/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ android {
disable.add("UnsafeOptInUsageError")
}

android {
ndkVersion = "25.2.9519653"
}

namespace = "${Constants.NAMESPACE}.${Constants.VPN_LIB_NAME}"
compileSdk = Constants.COMPILE_SDK

Expand Down Expand Up @@ -114,7 +118,8 @@ tasks.register<Exec>(Constants.BUILD_LIB_TASK) {
commandLine("echo", "Skipping library build")
return@register
}
val ndkPath = android.sdkDirectory.resolve("ndk").listFilesOrdered().lastOrNull()?.path ?: System.getenv("ANDROID_NDK_HOME")
// prefer system for reproducible builds
val ndkPath = System.getenv("ANDROID_NDK_HOME") ?: android.sdkDirectory.resolve("ndk").listFilesOrdered().lastOrNull()?.path
commandLine("echo", "NDK HOME: $ndkPath")
val script = "${projectDir.path}/src/main/scripts/build-libs.sh"
// TODO find a better way to limit builds
Expand Down

0 comments on commit 9144e1e

Please sign in to comment.