diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7dd39340a..5c7825a76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,6 +31,13 @@ jobs: cd "$(go env GOROOT)" curl "https://go-review.googlesource.com/changes/go~600296/revisions/5/patch" | base64 -d | patch --verbose -p 1 + - name: Setup Android NDK + uses: nttld/setup-ndk@v1 + id: setup-ndk + # Same version as https://gitlab.com/fdroid/fdroiddata/metadata/com.v2ray.ang.yml + with: + ndk-version: r27 + - name: Install gomobile run: | go install golang.org/x/mobile/cmd/gomobile@v0.0.0-20240806205939-81131f6468ab @@ -39,9 +46,24 @@ jobs: - name: Setup Android environment uses: android-actions/setup-android@v3 - - name: Build dependencies + - name: Prepare build dir run: | mkdir ${{ github.workspace }}/build + + - name: Build libtun2socks + run: | + cd ${{ github.workspace }}/build + git clone --depth=1 -b master https://github.com/2dust/AndroidLibV2rayLite.git + cd AndroidLibV2rayLite + git submodule update --init + bash compile-tun2socks.sh + tar -xvzf libtun2socks.so.tgz + cp -r libs/* ${{ github.workspace }}/V2rayNG/app/libs/ + env: + NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} + + - name: Build libv2ray + run: | cd ${{ github.workspace }}/build git clone --depth=1 -b main https://github.com/2dust/AndroidLibXrayLite.git cd AndroidLibXrayLite