Skip to content
Closed

Fix #57

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/main.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ jobs:
go mod tidy
gomobile bind -v -androidapi 21 -trimpath -ldflags='-s -w -buildid=' ./

- name: Upload build artifacts
uses: actions/upload-artifact@v4.6.2
with:
name: libv2ray
path: |
${{ github.workspace }}/libv2ray*r

- name: Upload AndroidLibV2rayLite to release
if: github.event.inputs.release_tag != ''
uses: svenstaro/upload-release-action@v2
Expand Down
97 changes: 97 additions & 0 deletions .github/workflows/tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Check and Update v2ray-core

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout our repository
uses: actions/checkout@v4.2.2
with:
fetch-depth: '0'

- name: Fetch latest release tag from external repository
id: fetch-release
run: |
EXTERNAL_REPO="v2fly/v2ray-core"
LATEST_TAG=$(curl -s https://api.github.com/repos/$EXTERNAL_REPO/tags | jq -r '.[0]')
LATEST_TAG_NAME=$(echo $LATEST_TAG | jq -r .name)
LATEST_TAG_SHA=$(echo $LATEST_TAG | jq -r .commit.sha)
echo "Latest tag from external repo: $LATEST_TAG_NAME"
echo "LATEST_TAG_NAME=$LATEST_TAG_NAME" >> $GITHUB_ENV
echo "LATEST_TAG_SHA=$LATEST_TAG_SHA" >> $GITHUB_ENV

- name: Fetch current repository release tag
id: fetch-current-tag
run: |
CURRENT_TAG_NAME=$(git describe --tags --abbrev=0)
echo "Current tag in this repo: $CURRENT_TAG_NAME"
echo "CURRENT_TAG_NAME=$CURRENT_TAG_NAME" >> $GITHUB_ENV

- name: Compare tags
id: compare-tags
run: |
if [ "$LATEST_TAG_NAME" != "$CURRENT_TAG_NAME" ]; then
if [ "$(printf '%s\n' "$LATEST_TAG_NAME" "$CURRENT_TAG_NAME" | sort -V | tail -n1)" == "$CURRENT_TAG_NAME" ]; then
echo "Upstream LATEST_TAG_NAME less than the CURRENT_TAG_NAME, no update needed."
else
echo "Tags are different. Updating..."
echo "needs_update=true" >> $GITHUB_ENV
fi
else
echo "Tags are the same. No update needed."
echo "needs_update=false" >> $GITHUB_ENV
fi

- name: Setup Golang
if: env.needs_update == 'true'
uses: actions/setup-go@v5.4.0
with:
go-version: 'stable'

- name: Update dependencies excluding gvisor and grpc
if: env.needs_update == 'true'
run: |
# Lock gvisor version to a specific revision
go mod edit -replace=gvisor.dev/gvisor=gvisor.dev/gvisor@v0.0.0-20231020174304-b8a429915ff1

# Lock grpc version to a specific revision
go mod edit -replace=google.golang.org/grpc=google.golang.org/grpc@v1.66.3

# Update specific dependency
go get github.com/v2fly/v2ray-core/v5@${{ env.LATEST_TAG_NAME }}

# Update all other dependencies
go get -u
go get gvisor.dev/gvisor@go

# Clean up and verify module dependencies
go mod tidy -v

# Show changes
git diff
- name: Commit and push changes
id: auto-commit-action
if: env.needs_update == 'true'
uses: stefanzweifel/git-auto-commit-action@v5.1.0
with:
commit_message: Updating v2ray-core to ${{ env.LATEST_TAG_NAME }} ${{ env.LATEST_TAG_SHA }}
tagging_message: ${{ env.LATEST_TAG_NAME }}

- name: Trigger build
if: env.needs_update == 'true' && steps.auto-commit-action.outputs.changes_detected == 'true'
run: |
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/main.yml/dispatches \
-d "{
\"ref\": \"main\",
\"inputs\": {
\"release_tag\": \"${{ env.LATEST_TAG_NAME }}\"
}
}"
47 changes: 25 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ module github.com/2dust/AndroidLibV2rayLite
go 1.24.2

require (
github.com/v2fly/v2ray-core/v5 v5.29.3
golang.org/x/mobile v0.0.0-20250305212854-3a7bc9f8a4de
golang.org/x/sys v0.31.0
github.com/v2fly/v2ray-core/v5 v5.30.0
golang.org/x/mobile v0.0.0-20250408133729-978277e7eaf7
golang.org/x/sys v0.32.0
)

require github.com/pion/transport/v3 v3.0.7 // indirect
Expand All @@ -18,42 +18,42 @@ require (
github.com/boljen/go-bitmap v0.0.0-20151001105940-23cd2fb0ce7d // indirect
github.com/bufbuild/protocompile v0.14.1 // indirect
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
github.com/cloudflare/circl v1.6.0 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
github.com/desertbit/timer v1.0.1 // indirect
github.com/dgryski/go-metro v0.0.0-20250106013310-edb8663e5e33 // indirect
github.com/ebfe/bcrypt_pbkdf v0.0.0-20140212075826-3c8d2dcb253a // indirect
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
github.com/golang-collections/go-datastructures v0.0.0-20150211160725-59788d5eb259 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e // indirect
github.com/google/pprof v0.0.0-20250417201159-ae779711f5d1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/improbable-eng/grpc-web v0.15.0 // indirect
github.com/jhump/protoreflect v1.17.0 // indirect
github.com/klauspost/compress v1.18.0 // indirect
github.com/klauspost/cpuid/v2 v2.2.10 // indirect
github.com/klauspost/reedsolomon v1.12.4 // indirect
github.com/lunixbochs/struc v0.0.0-20241101090106-8d528fa2c543 // indirect
github.com/miekg/dns v1.1.63 // indirect
github.com/miekg/dns v1.1.65 // indirect
github.com/mustafaturan/bus v1.0.2 // indirect
github.com/mustafaturan/monoton v1.0.0 // indirect
github.com/onsi/ginkgo/v2 v2.19.0 // indirect
github.com/onsi/ginkgo/v2 v2.23.4 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/logging v0.2.3 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/sctp v1.8.37 // indirect
github.com/pion/sctp v1.8.38 // indirect
github.com/pion/transport/v2 v2.2.10 // indirect
github.com/pires/go-proxyproto v0.8.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/quic-go/qpack v0.5.1 // indirect
github.com/quic-go/quic-go v0.50.1 // indirect
github.com/refraction-networking/utls v1.6.7 // indirect
github.com/riobard/go-bloom v0.0.0-20200614022211-cdc8013cb5b3 // indirect
github.com/rs/cors v1.7.0 // indirect
github.com/rs/cors v1.11.1 // indirect
github.com/secure-io/siv-go v0.0.0-20180922214919-5ff40651e2c4 // indirect
github.com/seiflotfy/cuckoofilter v0.0.0-20240715131351-a2f2c23f1771 // indirect
github.com/stretchr/objx v0.5.2 // indirect
Expand All @@ -66,24 +66,27 @@ require (
github.com/vincent-petithory/dataurl v1.0.0 // indirect
github.com/xiaokangwang/VLite v0.0.0-20231225174116-75fa4b06e9f2 // indirect
github.com/xtaci/smux v1.5.34 // indirect
go.starlark.net v0.0.0-20250318223901-d9371fef63fe // indirect
go.uber.org/mock v0.5.0 // indirect
go.starlark.net v0.0.0-20250417143717-f57e51f710eb // indirect
go.uber.org/automaxprocs v1.6.0 // indirect
go.uber.org/mock v0.5.1 // indirect
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
golang.org/x/crypto v0.36.0 // indirect
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
golang.org/x/crypto v0.37.0 // indirect
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
golang.org/x/mod v0.24.0 // indirect
golang.org/x/net v0.37.0 // indirect
golang.org/x/sync v0.12.0 // indirect
golang.org/x/text v0.23.0 // indirect
golang.org/x/net v0.39.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/text v0.24.0 // indirect
golang.org/x/time v0.11.0 // indirect
golang.org/x/tools v0.31.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
google.golang.org/grpc v1.71.0 // indirect
golang.org/x/tools v0.32.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250414145226-207652e42e2e // indirect
google.golang.org/grpc v1.71.1 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gvisor.dev/gvisor v0.0.0-20231020174304-b8a429915ff1 // indirect
gvisor.dev/gvisor v0.0.0-20250416204613-04a61c0f3bd5 // indirect
lukechampine.com/blake3 v1.4.0 // indirect
nhooyr.io/websocket v1.8.17 // indirect
)

replace google.golang.org/grpc v1.71.0 => google.golang.org/grpc v1.66.3
replace google.golang.org/grpc => google.golang.org/grpc v1.66.3

replace gvisor.dev/gvisor => gvisor.dev/gvisor v0.0.0-20231020174304-b8a429915ff1
Loading