diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3860588cb..caf7123a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,12 +21,23 @@ jobs: submodules: 'recursive' fetch-depth: '0' + - name: Prepare build dir + run: | + mkdir ${{ github.workspace }}/build + + - name: Fetch AndroidLibV2rayLite + run: | + cd ${{ github.workspace }}/build + git clone --depth=1 -b master https://github.com/2dust/AndroidLibV2rayLite.git + cd AndroidLibV2rayLite + git submodule update --init + - name: Restore cached libtun2socks id: cache-libtun2socks-restore uses: actions/cache/restore@v4 with: - path: ${{ github.workspace }}/AndroidLibV2rayLite/libs - key: libtun2socks-${{ runner.os }}-${{ hashFiles('.git/modules/AndroidLibV2rayLite/HEAD') }} + path: ${{ github.workspace }}/build/AndroidLibV2rayLite/libs + key: libtun2socks-${{ runner.os }}-${{ hashFiles('build/AndroidLibV2rayLite/.git/refs/heads/master') }}-${{ hashFiles('build/AndroidLibV2rayLite/.git/modules/badvpn/HEAD') }}-${{ hashFiles('build/AndroidLibV2rayLite/.git/modules/libancillary/HEAD') }} - name: Setup Android NDK uses: nttld/setup-ndk@v1 @@ -51,7 +62,7 @@ jobs: - name: Build libtun2socks if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true' run: | - cd ${{ github.workspace }}/AndroidLibV2rayLite + cd ${{ github.workspace }}/build/AndroidLibV2rayLite bash compile-tun2socks.sh tar -xvzf libtun2socks.so.tgz env: @@ -61,12 +72,12 @@ jobs: if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: - path: ${{ github.workspace }}/AndroidLibV2rayLite/libs - key: libtun2socks-${{ runner.os }}-${{ hashFiles('.git/modules/AndroidLibV2rayLite/HEAD') }} + path: ${{ github.workspace }}/build/AndroidLibV2rayLite/libs + key: libtun2socks-${{ runner.os }}-${{ hashFiles('build/AndroidLibV2rayLite/.git/refs/heads/master') }}-${{ hashFiles('build/AndroidLibV2rayLite/.git/modules/badvpn/HEAD') }}-${{ hashFiles('build/AndroidLibV2rayLite/.git/modules/libancillary/HEAD') }} - name: Copy libtun2socks run: | - cp -r ${{ github.workspace }}/AndroidLibV2rayLite/libs ${{ github.workspace }}/V2rayNG/app + cp -r ${{ github.workspace }}/build/AndroidLibV2rayLite/libs ${{ github.workspace }}/V2rayNG/app - name: Fetch AndroidLibXrayLite tag run: | diff --git a/.gitmodules b/.gitmodules index d29ffcdb0..5823c38a7 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "AndroidLibXrayLite"] path = AndroidLibXrayLite url = https://github.com/2dust/AndroidLibXrayLite -[submodule "AndroidLibV2rayLite"] - path = AndroidLibV2rayLite - url = https://github.com/2dust/AndroidLibV2rayLite diff --git a/AndroidLibV2rayLite b/AndroidLibV2rayLite deleted file mode 160000 index f1c405e6d..000000000 --- a/AndroidLibV2rayLite +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f1c405e6df58f1bc58eafa3440e0fdfcee57a869 diff --git a/AndroidLibV2rayLite/README.md b/AndroidLibV2rayLite/README.md new file mode 100644 index 000000000..118eefcf2 --- /dev/null +++ b/AndroidLibV2rayLite/README.md @@ -0,0 +1,20 @@ +# AndroidLibV2rayLite + +### Preparation +- latest Ubuntu environment +- At lease 30G free space +- Get Repo [AndroidLibV2rayLite](https://github.com/2dust/AndroidLibV2rayLite) or [AndroidLibXrayLite](https://github.com/2dust/AndroidLibXrayLite) +### Prepare Go +- Go to https://golang.org/doc/install and install latest go +- Make sure `go version` works as expected +### Prepare gomobile +- Go to https://pkg.go.dev/golang.org/x/mobile/cmd/gomobile and install gomobile +- export PATH=$PATH:~/go/bin +- Make sure `gomobile init` works as expected +### Prepare NDK +- Go to https://developer.android.com/ndk/downloads and install latest NDK +- export PATH=$PATH: +- Make sure `ndk-build -v` works as expected +### Make +- sudo apt install make +- Read and understand [build script](https://github.com/2dust/AndroidLibV2rayLite/blob/master/Makefile)