diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f65094093..6b4f5ae45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,8 +31,21 @@ jobs: 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 - if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true' + + - name: Fetch AndroidLibXrayLite + run: | + cd ${{ github.workspace }}/build + git clone --depth=1 -b main https://github.com/UjuiUjuMandan/AndroidLibXrayLite.git + + - name: Restore cached libv2ray + id: cache-libv2ray-restore + uses: actions/cache/restore@v4 + with: + path: ${{ github.workspace }}/build/AndroidLibXrayLite/ + key: libv2ray-${{ runner.os }}-${{ hashFiles('build/AndroidLibXrayLite/.git/refs/heads/main') }} + + - name: Setup Android NDK + if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true' || steps.cache-libv2ray-restore.outputs.cache-hit != 'true' uses: nttld/setup-ndk@v1 id: setup-ndk # Same version as https://gitlab.com/fdroid/fdroiddata/metadata/com.v2ray.ang.yml @@ -60,18 +73,6 @@ jobs: run: | cp -r ${{ github.workspace }}/build/AndroidLibV2rayLite/libs/* ${{ github.workspace }}/V2rayNG/app/libs/ - - name: Fetch AndroidLibXrayLite - run: | - cd ${{ github.workspace }}/build - git clone --depth=1 -b main https://github.com/UjuiUjuMandan/AndroidLibXrayLite.git - - - name: Restore cached libv2ray - id: cache-libv2ray-restore - uses: actions/cache/restore@v4 - with: - path: ${{ github.workspace }}/build/AndroidLibXrayLite/ - key: libv2ray-${{ runner.os }}-${{ hashFiles('build/AndroidLibXrayLite/.git/refs/heads/main') }} - - name: Setup Golang if: steps.cache-libv2ray-restore.outputs.cache-hit != 'true' uses: actions/setup-go@v5 @@ -92,6 +93,8 @@ jobs: gomobile init go mod tidy -v gomobile bind -trimpath -buildvcs=false -v -androidapi 21 -ldflags='-s -w -buildid=' ./ + env: + ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }} - name: Save libv2ray if: steps.cache-libv2ray-restore.outputs.cache-hit != 'true'