From 8bc48384200ba2d9a61f027033d0e2ae1ce7ffb5 Mon Sep 17 00:00:00 2001 From: Patryk Michalik Date: Wed, 17 Mar 2021 09:30:20 +0100 Subject: [PATCH] CI: Send notification when build starts, append metadata to `versionName` --- .github/workflows/build_debug_apk.yml | 16 +++++++++++++--- build.gradle | 12 +++++++++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_debug_apk.yml b/.github/workflows/build_debug_apk.yml index f04c632b6a..098cf27ada 100644 --- a/.github/workflows/build_debug_apk.yml +++ b/.github/workflows/build_debug_apk.yml @@ -7,8 +7,19 @@ on: - 11-dev jobs: + send-start-notification: + runs-on: ubuntu-latest + continue-on-error: true + steps: + - name: Send start notification + uses: appleboy/telegram-action@v0.1.0 + with: + to: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }} + token: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }} + format: New push to
11-dev
. Building debug APK… build-debug-apk: runs-on: ubuntu-latest + needs: send-start-notification continue-on-error: true steps: - name: Check out repository @@ -36,7 +47,7 @@ jobs: with: name: Debug APK path: build/outputs/apk/lawnWithQuickstep/debug/**.apk - send-notification: + send-end-notification: runs-on: ubuntu-latest needs: build-debug-apk steps: @@ -52,5 +63,4 @@ jobs: to: ${{ secrets.TELEGRAM_CI_CHANNEL_ID }} token: ${{ secrets.TELEGRAM_CI_BOT_TOKEN }} document: artifacts/debug-apk/**.apk - args: | - Build ${{ github.run_id }} finished with status ‘${{ env.WORKFLOW_CONCLUSION }}’. \ No newline at end of file + format: Build finished with status
${{ env.WORKFLOW_CONCLUSION }}
. Uploading APK if available… \ No newline at end of file diff --git a/build.gradle b/build.gradle index 6640de5e34..549585d0d2 100644 --- a/build.gradle +++ b/build.gradle @@ -46,6 +46,15 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'com.google.protobuf' +final def commitHash = { -> + final def stdout = new ByteArrayOutputStream() + exec { + commandLine 'git', 'rev-parse', '--short=7', 'HEAD' + standardOutput = stdout + } + stdout.toString().trim() +} + android { compileSdkVersion COMPILE_SDK buildToolsVersion BUILD_TOOLS_VERSION @@ -54,7 +63,8 @@ android { minSdkVersion 25 targetSdkVersion 30 versionCode 1 - versionName "1.0" + versionName "11.0-alpha.01+${commitHash()}" + setProperty("archivesBaseName", "Lawnchair-$versionName") testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true