From 77faab14b1d5c5f2e9c66a81e30ae1dd0dd13686 Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Tue, 7 Jan 2025 14:33:08 +0600 Subject: [PATCH] Tweak build workflows --- .github/workflows/build_pull_request.yml | 13 +++++++----- .github/workflows/build_push.yml | 25 ++++++++++++------------ 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index b62e42028..2f37bfd7c 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -25,9 +25,6 @@ jobs: - name: Clone repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 - - name: Dependency Review uses: actions/dependency-review-action@3b139cfc5fae8b618d3eae3675e383bb1769c019 # v4.5.0 @@ -40,8 +37,14 @@ jobs: - name: Set up gradle uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 - - name: Build app and run unit tests - run: ./gradlew spotlessCheck assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest + - name: Check code format + run: ./gradlew spotlessCheck + + - name: Build app + run: ./gradlew assembleStandardRelease + + - name: Run unit tests + run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest - name: Upload APK uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 diff --git a/.github/workflows/build_push.yml b/.github/workflows/build_push.yml index 6f6f7d063..97de96401 100644 --- a/.github/workflows/build_push.yml +++ b/.github/workflows/build_push.yml @@ -19,13 +19,6 @@ jobs: - name: Clone repo uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - name: Validate Gradle Wrapper - uses: gradle/actions/wrapper-validation@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 - - - name: Setup Android SDK - run: | - ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager "build-tools;29.0.3" - - name: Set up JDK uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0 with: @@ -35,8 +28,14 @@ jobs: - name: Set up gradle uses: gradle/actions/setup-gradle@0bdd871935719febd78681f197cd39af5b6e16a6 # v4.2.2 - - name: Build app and run unit tests - run: ./gradlew spotlessCheck assembleStandardRelease testReleaseUnitTest testStandardReleaseUnitTest + - name: Check code format + run: ./gradlew spotlessCheck + + - name: Build app + run: ./gradlew assembleStandardRelease + + - name: Run unit tests + run: ./gradlew testReleaseUnitTest testStandardReleaseUnitTest - name: Upload APK uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 @@ -77,19 +76,19 @@ jobs: sha=`sha256sum mihon-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` echo "APK_UNIVERSAL_SHA=$sha" >> $GITHUB_ENV - cp app/build/outputs/apk/standard/release/app-standard-arm64-v8a-release-unsigned-signed.apk mihon-arm64-v8a-${{ env.VERSION_TAG }}.apk + mv app/build/outputs/apk/standard/release/app-standard-arm64-v8a-release-unsigned-signed.apk mihon-arm64-v8a-${{ env.VERSION_TAG }}.apk sha=`sha256sum mihon-arm64-v8a-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` echo "APK_ARM64_V8A_SHA=$sha" >> $GITHUB_ENV - cp app/build/outputs/apk/standard/release/app-standard-armeabi-v7a-release-unsigned-signed.apk mihon-armeabi-v7a-${{ env.VERSION_TAG }}.apk + mv app/build/outputs/apk/standard/release/app-standard-armeabi-v7a-release-unsigned-signed.apk mihon-armeabi-v7a-${{ env.VERSION_TAG }}.apk sha=`sha256sum mihon-armeabi-v7a-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` echo "APK_ARMEABI_V7A_SHA=$sha" >> $GITHUB_ENV - cp app/build/outputs/apk/standard/release/app-standard-x86-release-unsigned-signed.apk mihon-x86-${{ env.VERSION_TAG }}.apk + mv app/build/outputs/apk/standard/release/app-standard-x86-release-unsigned-signed.apk mihon-x86-${{ env.VERSION_TAG }}.apk sha=`sha256sum mihon-x86-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` echo "APK_X86_SHA=$sha" >> $GITHUB_ENV - cp app/build/outputs/apk/standard/release/app-standard-x86_64-release-unsigned-signed.apk mihon-x86_64-${{ env.VERSION_TAG }}.apk + mv app/build/outputs/apk/standard/release/app-standard-x86_64-release-unsigned-signed.apk mihon-x86_64-${{ env.VERSION_TAG }}.apk sha=`sha256sum mihon-x86_64-${{ env.VERSION_TAG }}.apk | awk '{ print $1 }'` echo "APK_X86_64_SHA=$sha" >> $GITHUB_ENV