Skip to content

Version 1.3.0: Replace tun2socks with hev-socks5-tunnel and performan… #16

Version 1.3.0: Replace tun2socks with hev-socks5-tunnel and performan…

Version 1.3.0: Replace tun2socks with hev-socks5-tunnel and performan… #16

Workflow file for this run

name: Build Android APK
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
OPENSSL_VERSION: "3.0.15"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install Android NDK
run: |
sdkmanager --install "ndk;27.0.12077973"
echo "ANDROID_NDK_HOME=$ANDROID_HOME/ndk/27.0.12077973" >> $GITHUB_ENV
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-linux-android,armv7-linux-androideabi,x86_64-linux-android,i686-linux-android
- name: Install cargo-ndk
run: cargo install cargo-ndk
- name: Cache OpenSSL
id: cache-openssl
uses: actions/cache@v4
with:
path: ~/android-openssl
key: openssl-android-${{ env.OPENSSL_VERSION }}
- name: Build OpenSSL for Android
if: steps.cache-openssl.outputs.cache-hit != 'true'
run: |
chmod +x app/scripts/build-openssl-android.sh
OUTPUT_DIR=$HOME/android-openssl/android-ssl \
OPENSSL_VERSION=${{ env.OPENSSL_VERSION }} \
./app/scripts/build-openssl-android.sh
- name: Verify OpenSSL installation
run: |
echo "Checking OpenSSL files..."
ls -la ~/android-openssl/android-ssl/
for abi in arm64-v8a armeabi-v7a x86 x86_64; do
echo "Checking $abi..."
ls -la ~/android-openssl/android-ssl/$abi/lib/
done
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cache Rust/Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
app/src/main/rust/slipstream-rust/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Decode Keystore
env:
KEYSTORE_BASE64: ${{ secrets.KEYSTORE_BASE64 }}
run: |
if [ -n "$KEYSTORE_BASE64" ]; then
echo "$KEYSTORE_BASE64" | base64 -d > slipnet-release.keystore
echo "KEYSTORE_DECODED=true" >> $GITHUB_ENV
fi
- name: Create keystore.properties
if: env.KEYSTORE_DECODED == 'true'
env:
KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
run: |
cat > keystore.properties << EOF
storeFile=../slipnet-release.keystore
storePassword=$KEYSTORE_PASSWORD
keyAlias=$KEY_ALIAS
keyPassword=$KEY_PASSWORD
EOF
- name: Build Release APK
run: ./gradlew assembleRelease --no-daemon
- name: Upload Release APK
uses: actions/upload-artifact@v4
with:
name: app-release
path: app/build/outputs/apk/release/*.apk
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- name: Download Release APK
uses: actions/download-artifact@v4
with:
name: app-release
path: ./artifacts
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: ./artifacts/*.apk
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}