From 4946af6df1962ed7ee859292d5322434bd2b5b45 Mon Sep 17 00:00:00 2001 From: FireLord Date: Sun, 14 Jan 2024 00:25:05 +0530 Subject: [PATCH] github-action: Cleanup ci steps --- .github/ci-gradle.properties | 24 --------------------- .github/workflows/release.yml | 40 ++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 39 deletions(-) delete mode 100644 .github/ci-gradle.properties diff --git a/.github/ci-gradle.properties b/.github/ci-gradle.properties deleted file mode 100644 index 0cef9a7..0000000 --- a/.github/ci-gradle.properties +++ /dev/null @@ -1,24 +0,0 @@ -# Project-wide Gradle settings. -# IDE (e.g. Android Studio) users: -# Gradle settings configured through the IDE *will override* -# any settings specified in this file. -# For more details on how to configure your build environment visit -# http://www.gradle.org/docs/current/userguide/build_environment.html -# Specifies the JVM arguments used for the daemon process. -# The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -# When configured, Gradle will run in incubating parallel mode. -# This option should only be used with decoupled projects. More details, visit -# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects -# org.gradle.parallel=true -# AndroidX package structure to make it clearer which packages are bundled with the -# Android operating system, and which are packaged with your app"s APK -# https://developer.android.com/topic/libraries/support-library/androidx-rn -android.useAndroidX=true -# Automatically convert third-party libraries to use AndroidX -android.enableJetifier=true -# Kotlin code style for this project: "official" or "obsolete": -kotlin.code.style=official -android.defaults.buildfeatures.buildconfig=true -android.nonTransitiveRClass=false -android.nonFinalResIds=false \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb3b27a..d1283f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,10 @@ name: Build release + on: push: - branches: [ android ] + branches: [android] pull_request: - branches: [ android ] + branches: [android] paths: - '.github/**' - 'app/**' @@ -17,22 +18,29 @@ jobs: generate-release-build: runs-on: ubuntu-latest if: "!contains(github.event.head_commit.message, '[ci skip]')" + + env: + GRADLE_USER_HOME: ~/.gradle + steps: - - uses: actions/checkout@v3 - - uses: actions/setup-java@v3 - with: - distribution: 'temurin' - java-version: '17' - name: Checkout repository uses: actions/checkout@v2 - - - name: Decrypt secrets - run: release/signing-setup.sh "$ENCRYPT_KEY" - env: - ENCRYPT_KEY: ${{ secrets.ENCRYPT_KEY }} - - name: Copy CI gradle.properties - run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties + - name: Set up JDK + uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: '17' + + - name: Cache Gradle dependencies + uses: actions/cache@v2 + with: + path: | + ${{ env.GRADLE_USER_HOME }}/caches + ${{ env.GRADLE_USER_HOME }}/wrapper + key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + gradle-${{ runner.os }}- - name: Download gradle dependencies run: ./gradlew dependencies @@ -41,13 +49,15 @@ jobs: run: ./gradlew :app:assembleRelease - name: Send APK to Telegram + if: github.event_name == 'push' # Only execute for push events, not pull requests run: release/deploy-telegram.sh env: TG_TO: ${{ secrets.TELEGRAM_TO }} TG_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} TG_FILE: ./app/build/outputs/apk/release/app-release.apk - + - name: Send changelog to Telegram + if: github.event_name == 'push' # Only execute for push events, not pull requests run: release/changelog-telegram.sh env: TG_TO: ${{ secrets.TELEGRAM_TO }}