Workflows: Build Android(7+) using NDK; Add Android(7+) amd64 build (#4664)

Makes net.LookupIP() work on Android builds
This commit is contained in:
j2rong4cn 2025-04-29 19:29:52 +08:00 committed by GitHub
parent aa4134f4a6
commit 16641fc4b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 }}