From 16641fc4b57759c1003d9693e2a3887fbf91c9fe Mon Sep 17 00:00:00 2001 From: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com> Date: Tue, 29 Apr 2025 19:29:52 +0800 Subject: [PATCH] Workflows: Build Android(7+) using NDK; Add Android(7+) amd64 build (#4664) Makes net.LookupIP() work on Android builds --- .github/workflows/release.yml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4de01e48..c52f585e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -42,6 +42,11 @@ jobs: - goos: android goarch: arm64 # END Android ARM 8 + # BEGIN Android AMD64 + - goos: android + goarch: amd64 + patch-assetname: android-amd64 + # END Android AMD64 # Windows ARM - goos: windows goarch: arm64 @@ -104,6 +109,19 @@ jobs: - name: Checkout codebase uses: actions/checkout@v4 + - name: Set up NDK + if: matrix.goos == 'android' + run: | + wget -qO android-ndk.zip https://dl.google.com/android/repository/android-ndk-r28b-linux.zip + unzip android-ndk.zip + rm android-ndk.zip + declare -A arches=( + ["amd64"]="x86_64-linux-android24-clang" + ["arm64"]="aarch64-linux-android24-clang" + ) + echo CC="$(realpath android-ndk-*/toolchains/llvm/prebuilt/linux-x86_64/bin)/${arches[${{ matrix.goarch }}]}" >> $GITHUB_ENV + echo CGO_ENABLED=1 >> $GITHUB_ENV + - name: Show workflow information run: | _NAME=${{ matrix.patch-assetname }} @@ -119,7 +137,7 @@ jobs: - name: Get project dependencies run: go mod download - + - name: Build Xray run: | mkdir -p build_assets