2021-02-18 02:32:07 +00:00
|
|
|
name: Debug build
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
- '.github/**'
|
|
|
|
- '!.github/workflows/debug.yml'
|
2021-02-18 05:29:01 +00:00
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- dev
|
|
|
|
|
2021-02-18 02:32:07 +00:00
|
|
|
jobs:
|
|
|
|
native:
|
|
|
|
name: Native Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Android SDK Tools
|
|
|
|
uses: android-actions/setup-android@v2
|
|
|
|
- name: Native Cache
|
|
|
|
uses: actions/cache@main
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/libs
|
|
|
|
TMessagesProj/src/main/libs
|
|
|
|
key: ${{ hashFiles('TMessagesProj/jni/**', 'ss-rust/src/main/rust/**') }}
|
|
|
|
- name: Check Cache
|
|
|
|
run: |
|
|
|
|
[ -f "TMessagesProj/libs/libv2ray.aar" ] && echo "Cache found." || echo "CONTINUE=true" >> $GITHUB_ENV
|
|
|
|
- name: Install NDK
|
|
|
|
if: env.CONTINUE
|
|
|
|
run: |
|
|
|
|
echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install "ndk;21.3.6528147" --sdk_root=${ANDROID_SDK_ROOT} &> /dev/null
|
|
|
|
echo "sdk.dir=${ANDROID_HOME}" > local.properties
|
|
|
|
echo "ndk.dir=${ANDROID_HOME}/ndk/21.3.6528147" >> local.properties
|
|
|
|
- uses: actions/setup-go@v2
|
|
|
|
if: env.CONTINUE
|
|
|
|
with:
|
|
|
|
go-version: ^1.15
|
|
|
|
- name: Native Build
|
|
|
|
if: env.CONTINUE
|
|
|
|
run: |
|
|
|
|
./run init action
|
|
|
|
./run init libs
|
|
|
|
./run libs update
|
|
|
|
debug:
|
|
|
|
name: Debug Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: native
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
flavor:
|
|
|
|
- FullRelease
|
|
|
|
- FullReleaseNoGcm
|
|
|
|
- FullAppleEmojiRelease
|
|
|
|
- FullAppleEmojiReleaseNoGcm
|
|
|
|
- MiniRelease
|
|
|
|
- MiniReleaseNoGcm
|
|
|
|
- MiniAppleEmojiRelease
|
|
|
|
- MiniAppleEmojiReleaseNoGcm
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Android SDK Tools
|
|
|
|
uses: android-actions/setup-android@v2
|
|
|
|
- name: Native Cache
|
|
|
|
uses: actions/cache@main
|
|
|
|
with:
|
|
|
|
path: |
|
|
|
|
TMessagesProj/libs
|
|
|
|
TMessagesProj/src/main/libs
|
|
|
|
key: ${{ hashFiles('TMessagesProj/jni/**', 'ss-rust/src/main/rust/**') }}
|
|
|
|
- name: Fix Gradle Memoery
|
|
|
|
run: |
|
|
|
|
sed -i -e "s/16384/6144/g" gradle.properties
|
|
|
|
echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" > local.properties
|
|
|
|
- name: Gradle cache
|
|
|
|
uses: actions/cache@main
|
|
|
|
with:
|
|
|
|
path: ~/.gradle
|
|
|
|
key: gradle-${{ hashFiles('**/*.gradle') }}
|
|
|
|
- name: Debug Build
|
|
|
|
run: |
|
|
|
|
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
|
|
|
|
export DEBUG_BUILD=true
|
|
|
|
./gradlew TMessagesProj:assemble${{ matrix.flavor }}
|
|
|
|
|
|
|
|
echo "APK_FILE=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk')" >> $GITHUB_ENV
|
|
|
|
echo "APK_FILE_ARMV7=$(find TMessagesProj/build/outputs/apk -name '*armeabi*.apk')" >> $GITHUB_ENV
|
|
|
|
echo "APK_FILE_X86=$(find TMessagesProj/build/outputs/apk -name '*x86-*.apk')" >> $GITHUB_ENV
|
|
|
|
echo "APK_FILE_X64=$(find TMessagesProj/build/outputs/apk -name '*x86_64*.apk')" >> $GITHUB_ENV
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
name: Upload apk (arm64-v8a)
|
|
|
|
with:
|
|
|
|
name: NekoX-${{ matrix.flavor }}-arm64-v8a
|
|
|
|
path: ${{ env.APK_FILE }}
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
name: Upload apk (armeabi-v7a)
|
|
|
|
with:
|
|
|
|
name: NekoX-${{ matrix.flavor }}-armeabi-v7a
|
|
|
|
path: ${{ env.APK_FILE_ARMV7 }}
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
name: Upload apk (x86_64)
|
|
|
|
with:
|
|
|
|
name: NekoX-${{ matrix.flavor }}-x86_64
|
|
|
|
path: ${{ env.APK_FILE_X64 }}
|
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
name: Upload apk (x86)
|
|
|
|
with:
|
|
|
|
name: NekoX-${{ matrix.flavor }}-x86
|
|
|
|
path: ${{ env.APK_FILE_X86 }}
|