-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Download libv2ray from 2dust/AndroidLibXrayLite (#4200)
- Loading branch information
1 parent
affb107
commit c0fed0b
Showing
1 changed file
with
9 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,20 +36,8 @@ 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: Fetch AndroidLibXrayLite | ||
run: | | ||
cd ${{ github.workspace }}/build | ||
git clone --depth=1 -b main https://github.com/2dust/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' | ||
if: steps.cache-libtun2socks-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,7 +48,7 @@ jobs: | |
local-cache: true | ||
|
||
- name: Restore Android Symlinks | ||
if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true' || steps.cache-libv2ray-restore.outputs.cache-hit != 'true' | ||
if: steps.cache-libtun2socks-restore.outputs.cache-hit != 'true' | ||
run: | | ||
directory="${{ steps.setup-ndk.outputs.ndk-path }}/toolchains/llvm/prebuilt/linux-x86_64/bin" | ||
find "$directory" -type l | while read link; do | ||
|
@@ -91,46 +79,13 @@ jobs: | |
run: | | ||
cp -r ${{ github.workspace }}/build/AndroidLibV2rayLite/libs/* ${{ github.workspace }}/V2rayNG/app/libs/ | ||
- name: Setup Golang | ||
if: steps.cache-libv2ray-restore.outputs.cache-hit != 'true' | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.23.4' | ||
cache: false | ||
|
||
- name: Patch Go use 600296 | ||
if: steps.cache-libv2ray-restore.outputs.cache-hit != 'true' | ||
#https://go-review.googlesource.com/c/go/+/600296 | ||
run: | | ||
cd "$(go env GOROOT)" | ||
curl "https://go-review.googlesource.com/changes/go~600296/revisions/5/patch" | base64 -d | patch --verbose -p 1 | ||
- name: Install gomobile | ||
if: steps.cache-libv2ray-restore.outputs.cache-hit != 'true' | ||
run: | | ||
CGO_ENABLED=0 go install -trimpath -ldflags="-w -s" github.com/sagernet/gomobile/cmd/[email protected] | ||
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH | ||
- name: Build libv2ray | ||
if: steps.cache-libv2ray-restore.outputs.cache-hit != 'true' | ||
run: | | ||
cd ${{ github.workspace }}/build/AndroidLibXrayLite | ||
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' | ||
uses: actions/cache/save@v4 | ||
- name: Download libv2ray | ||
uses: robinraju/release-downloader@v1 | ||
with: | ||
path: ${{ github.workspace }}/build/AndroidLibXrayLite/ | ||
key: libv2ray-${{ runner.os }}-${{ hashFiles('build/AndroidLibXrayLite/.git/refs/heads/main') }} | ||
|
||
- name: Copy libv2ray | ||
run: | | ||
cp -r ${{ github.workspace }}/build/AndroidLibXrayLite/*.aar ${{ github.workspace }}/V2rayNG/app/libs/ | ||
repository: '2dust/AndroidLibXrayLite' | ||
latest: true | ||
fileName: 'libv2ray.aar' | ||
out-file-path: V2rayNG/app/libs/ | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v4 | ||
|
@@ -183,4 +138,4 @@ jobs: | |
file: ${{ github.workspace }}/V2rayNG/app/build/outputs/apk/*playstore*/release/*.apk | ||
tag: ${{ github.event.inputs.release_tag }} | ||
file_glob: true | ||
prerelease: true | ||
prerelease: true |