Skip to content

Commit 497da3a

Browse files
committed
Workflows: Build Android Using NDK
1 parent 58c4866 commit 497da3a

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/release.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,21 @@ jobs:
104104
- name: Checkout codebase
105105
uses: actions/checkout@v4
106106

107+
- name: Set up NDK
108+
if: matrix.goos == 'android'
109+
run: |
110+
wget -qO android-ndk.zip https://dl.google.com/android/repository/android-ndk-r28b-linux.zip
111+
unzip android-ndk.zip
112+
rm android-ndk.zip
113+
declare -A arches=(
114+
["amd64"]="x86_64-linux-android24-clang"
115+
["arm64"]="aarch64-linux-android24-clang"
116+
["386"]="i686-linux-android24-clang"
117+
["arm7"]="armv7a-linux-androideabi24-clang"
118+
)
119+
echo CC="$(realpath android-ndk-*/toolchains/llvm/prebuilt/linux-x86_64/bin)/${arches[${{ matrix.goarch }}]}" >> $GITHUB_ENV
120+
echo CGO_ENABLED=1 >> $GITHUB_ENV
121+
107122
- name: Show workflow information
108123
run: |
109124
_NAME=${{ matrix.patch-assetname }}
@@ -119,7 +134,7 @@ jobs:
119134

120135
- name: Get project dependencies
121136
run: go mod download
122-
137+
123138
- name: Build Xray
124139
run: |
125140
mkdir -p build_assets

0 commit comments

Comments
 (0)