Skip to content

feat(ui): add optional premium UI effects (glassmorphism, mesh gradie… #218

feat(ui): add optional premium UI effects (glassmorphism, mesh gradie…

feat(ui): add optional premium UI effects (glassmorphism, mesh gradie… #218

Workflow file for this run

name: Android Release Build
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Accept Android SDK licenses
run: yes | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager --licenses || true
- name: Install NDK
run: |
NDK_VER="28.2.13676358"
echo "y" | $ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager \
--channel=0 \
--install "ndk;$NDK_VER"
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/$NDK_VER" >> $GITHUB_ENV
echo "NDK_HOME=$ANDROID_HOME/ndk/$NDK_VER" >> $GITHUB_ENV
# Set ndkVersion in build.gradle.kts if needed, but it seems it works without it if we set ANDROID_NDK_HOME
- name: Build libhevtun
run: |
bash compile-hevtun.sh
mkdir -p V2rayNG/app/libs
cp -r libs/* V2rayNG/app/libs/
- name: Cache Unified libv2ray
id: cache-v2ray
uses: actions/cache@v4
with:
path: V2rayNG/app/libs/libv2ray.aar
key: ${{ runner.os }}-libv2ray-v3-${{ hashFiles('AndroidLibXrayLite/**/*.go', 'v2w-core/**/*.go', 'AndroidLibXrayLite/go.sum', 'v2w-core/go.sum') }}
- name: Set up Go
if: steps.cache-v2ray.outputs.cache-hit != 'true'
uses: actions/setup-go@v5
with:
go-version: '1.26.x'
- name: Build Unified libv2ray (Original Core + Scanner Core)
if: steps.cache-v2ray.outputs.cache-hit != 'true'
run: |
export GOPROXY=https://proxy.golang.org,direct
go install golang.org/x/mobile/cmd/gomobile@latest || (sleep 5 && go install golang.org/x/mobile/cmd/gomobile@latest)
go install golang.org/x/mobile/cmd/gobind@latest || (sleep 5 && go install golang.org/x/mobile/cmd/gobind@latest)
gomobile init
# Patch anet to fix Go 1.26 incompatibility (must download first)
pushd AndroidLibXrayLite
go mod download
popd
pushd v2w-core
go mod download
popd
ANET_DIR="$(go env GOPATH)/pkg/mod/github.com/wlynxg/anet@v0.0.5"
chmod -R u+w "$ANET_DIR" 2>/dev/null || true
sed -i '/\/\/go:linkname zoneCache/d' "$ANET_DIR/interface_android.go" || true
sed -i '/var zoneCache ipv6ZoneCache/d' "$ANET_DIR/interface_android.go" || true
sed -i '/\/\/go:linkname zoneCacheX/d' "$ANET_DIR/interface_android.go" || true
sed -i '/var zoneCacheX ipv6ZoneCache/d' "$ANET_DIR/interface_android.go" || true
sed -i '/zoneCache\.update/d' "$ANET_DIR/interface_android.go" || true
sed -i '/zoneCacheX\.update/d' "$ANET_DIR/interface_android.go" || true
# Patch libv2ray_main.go to include V2W scanner bindings
if ! grep -q "RunV2WScanner" AndroidLibXrayLite/libv2ray_main.go; then
sed -i '/mobasset "golang.org\/x\/mobile\/asset"/a \ \t"github.com/kiktor/v2w-core/v2wscanner"' AndroidLibXrayLite/libv2ray_main.go
printf '\ntype V2WScanCallback interface {\n\tOnServerSuccess(configUrl string, delay int64)\n\tOnScanComplete(totalSuccess int64, totalFailed int64)\n}\n\nfunc RunV2WScanner(configs string, maxConcurrency int64, callback V2WScanCallback) {\n\tv2wscanner.RunV2WScanner(configs, maxConcurrency, callback)\n}\n\nfunc StopV2WScanner() {\n\tv2wscanner.StopV2WScanner()\n}\n' >> AndroidLibXrayLite/libv2ray_main.go
fi
# Run gomobile from within AndroidLibXrayLite so it is the "current module"
pushd AndroidLibXrayLite
V2W_ABS="$(readlink -f ../v2w-core)"
go mod edit -require github.com/kiktor/v2w-core@v0.0.0
go mod edit -replace "github.com/kiktor/v2w-core=$V2W_ABS"
GOWORK=off go mod tidy
GOWORK=off gomobile bind -v -androidapi 21 -target=android \
-o ../V2rayNG/app/libs/libv2ray.aar \
.
popd
- name: Grant execute permission for gradlew
run: chmod +x gradlew
working-directory: V2rayNG
- name: Decode Keystore
run: echo "${{ secrets.RELEASE_KEYSTORE }}" | base64 --decode > release.keystore
working-directory: V2rayNG
- name: Build with Gradle
run: |
./gradlew assembleRelease \
-Pandroid.injected.signing.store.file=$PWD/release.keystore \
-Pandroid.injected.signing.store.password=${{ secrets.RELEASE_KEYSTORE_PASSWORD }} \
-Pandroid.injected.signing.key.alias=${{ secrets.RELEASE_KEY_ALIAS }} \
-Pandroid.injected.signing.key.password=${{ secrets.RELEASE_KEY_PASSWORD }}
working-directory: V2rayNG
- name: Prepare Release Assets
run: |
mkdir -p release-apks
find V2rayNG/app/build/outputs/apk/ -name "*.apk" -type f -exec cp {} release-apks/ \;
cd release-apks
sha256sum *.apk > sha256sum.txt
- name: Create Release and Upload APK
uses: softprops/action-gh-release@v2
with:
prerelease: true
files: |
release-apks/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}