From 99d38cb3710d98393bd746c22dcebb7f9ea81c43 Mon Sep 17 00:00:00 2001 From: luvletter2333 Date: Tue, 21 Dec 2021 15:23:33 +0800 Subject: [PATCH] CI: send debug builds to devs --- .github/workflows/debug.yml | 56 +++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/debug.yml b/.github/workflows/debug.yml index 83b317610..1687fbb7a 100644 --- a/.github/workflows/debug.yml +++ b/.github/workflows/debug.yml @@ -341,3 +341,59 @@ jobs: with: name: NekoX-${{ matrix.flavor }}-x86 path: ${{ env.APK_FILE_X86 }} + + build-dev: + name: Gradle Build + runs-on: ubuntu-latest + needs: + - native + - v2ray + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Android SDK Tools + uses: android-actions/setup-android@v2 + - name: Fetch Status + run: | + git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status + git submodule status TMessagesProj/jni/boringssl > boringssl_status + git submodule status ss-rust/src/main/rust/shadowsocks-rust > shadowsocks_status + git submodule status 'ssr-libev/*' > shadowsocksr_status + git submodule status v2ray > v2ray_status + - name: Native Cache (arm64-v8a) + uses: actions/cache@v2 + with: + path: | + TMessagesProj/src/main/libs + key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a + - name: V2ray Cache + uses: actions/cache@v2 + with: + path: | + TMessagesProj/libs/libv2ray.aar + key: ${{ hashFiles('bin/libs/v2ray/*', 'v2ray_status') }} + - name: Configure Gradle + run: | + sed -i -e "s/16384/6144/g" gradle.properties + echo "sdk.dir=${ANDROID_HOME}" >> local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk-bundle" >> local.properties + - name: Gradle cache + uses: actions/cache@v2 + with: + path: ~/.gradle + key: gradle-${{ hashFiles('**/*.gradle') }} + - name: Debug Build + run: | + export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" + export DEBUG_BUILD=true + export NATIVE_TARGET=arm64-v8a + ./gradlew TMessagesProj:assembleMiniRelease + - name: Send Build + run: | + apk=$(find TMessagesProj/build/outputs/apk/mini/release -name '*arm64-v8a*.apk' | head -n 1) + curl https://api.telegram.org/bot${{ secrets.HELPER_BOT_TOKEN }}/sendDocument \ + -X POST \ + -F chat_id="${{ secrets.HELPER_BOT_TARGET }}" \ + -F document="@$apk" \ + -F caption="$GITHUB_SHA" \ + --silent --show-error --fail >/dev/null \ No newline at end of file