From ccf7efb44870dabb64191d315f358e99f73f2fa7 Mon Sep 17 00:00:00 2001 From: NekoInverter <42698724+NekoInverter@users.noreply.github.com> Date: Sun, 15 Mar 2020 17:22:09 +0800 Subject: [PATCH] Auto post --- .github/workflows/android.yml | 8 ++++++++ app/build.gradle | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 80bf37c0..fb043a43 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -29,6 +29,14 @@ jobs: run: | chmod +x gradlew ./gradlew assembleRelease + - name: Post to channel + env: + CHANNEL_ID: ${{ secrets.CHANNEL_ID }} + BOT_TOKEN: ${{ secrets.BOT_TOKEN }} + run: | + OUTPUT="app/build/outputs" + export name=$(find $OUTPUT/apk -name "*.apk") + curl https://api.telegram.org/bot${BOT_TOKEN}/sendDocument -X POST -F chat_id="$CHANNEL_ID" -F document="@$name" - uses: actions/upload-artifact@master name: Upload artifact with: diff --git a/app/build.gradle b/app/build.gradle index 8a87dd64..ce1201bc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -51,6 +51,12 @@ android { sourceCompatibility = 1.8 targetCompatibility = 1.8 } + + applicationVariants.all { variant -> + variant.outputs.all { output -> + outputFileName = "EdXposedManagerR-${defaultConfig.versionName}-${defaultConfig.versionCode}-${buildType.name}.apk" + } + } } dependencies {