diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d5c8290..1a4de7d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,11 +78,19 @@ jobs: run: | cp -r ${{ github.workspace }}/build/AndroidLibV2rayLite/libs ${{ github.workspace }}/V2rayNG/app + - name: Fetch AndroidLibXrayLite tag + run: | + pushd AndroidLibXrayLite + CURRENT_TAG=$(git describe --tags --abbrev=0 || echo "none") + echo "Current tag in this repo: $CURRENT_TAG" + echo "CURRENT_TAG=$CURRENT_TAG" >> $GITHUB_ENV + popd + - name: Download libv2ray uses: robinraju/release-downloader@v1 with: repository: '2dust/AndroidLibXrayLite' - latest: true + tag: ${{ env.CURRENT_TAG }} fileName: 'libv2ray.aar' out-file-path: V2rayNG/app/libs/ @@ -93,18 +101,11 @@ jobs: path: ${{ github.workspace }}/hysteria/libs key: libhysteria2-${{ runner.os }}-${{ hashFiles('.git/modules/hysteria/HEAD') }}-${{ hashFiles('libhysteria.sh') }} - - name: Fetch Go version from AndroidLibXrayLite - if: steps.cache-libhysteria2-restore.outputs.cache-hit != 'true' - run: | - GO_VERSION=$(curl -sL https://github.com/2dust/AndroidLibXrayLite/raw/refs/heads/main/go.mod | sed -n -E 's/.*go ([0-9]+\.[0-9]+\.[0-9]+).*/\1/p') - echo "Go version: $GO_VERSION" - echo "GO_VERSION=$GO_VERSION" >> $GITHUB_ENV - - name: Setup Golang if: steps.cache-libhysteria2-restore.outputs.cache-hit != 'true' uses: actions/setup-go@v5 with: - go-version: '${{ env.GO_VERSION }}' + go-mod-file: 'AndroidLibXrayLite/go.mod' - name: Build libhysteria2 if: steps.cache-libhysteria2-restore.outputs.cache-hit != 'true' diff --git a/.gitmodules b/.gitmodules index b0a1e97d..5823c38a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "hysteria"] path = hysteria url = https://github.com/apernet/hysteria +[submodule "AndroidLibXrayLite"] + path = AndroidLibXrayLite + url = https://github.com/2dust/AndroidLibXrayLite diff --git a/AndroidLibXrayLite b/AndroidLibXrayLite new file mode 160000 index 00000000..01843401 --- /dev/null +++ b/AndroidLibXrayLite @@ -0,0 +1 @@ +Subproject commit 01843401730427c6ffc8bec7f5f352e91c42421b