Separate debug and release APK build to reduce CI build times.

This commit is contained in:
Miku AuahDark
2024-02-16 10:23:55 +08:00
parent 6e3b44e1cc
commit 1a4915b48a
+14 -3
View File
@@ -5,6 +5,9 @@ on: [push, pull_request]
jobs: jobs:
build-android: build-android:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
steps: steps:
- name: Prepare Environment - name: Prepare Environment
run: sudo apt-get update && curl -Lo kitware-archive.sh https://apt.kitware.com/kitware-archive.sh && sudo bash ./kitware-archive.sh run: sudo apt-get update && curl -Lo kitware-archive.sh https://apt.kitware.com/kitware-archive.sh && sudo bash ./kitware-archive.sh
@@ -20,29 +23,37 @@ jobs:
distribution: adopt-hotspot distribution: adopt-hotspot
java-version: 17 java-version: 17
cache: gradle cache: gradle
- name: Build - name: Build Normal Flavor
run: bash ./gradlew assembleNormalRecordDebug assembleNormalRecordRelease bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease run: bash ./gradlew assembleNormalRecord${{ matrix.build_type }}
- name: Build Release-specific Binaries
if: ${{ matrix.build_type == 'Release' }}
run: bash ./gradlew bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease
- name: Artifact (Normal debug APK) - name: Artifact (Normal debug APK)
if: ${{ matrix.build_type == 'Debug' }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: love-android-debug.apk name: love-android-debug.apk
path: app/build/outputs/apk/normalRecord/debug/app-normal-record-debug.apk path: app/build/outputs/apk/normalRecord/debug/app-normal-record-debug.apk
- name: Artifact (Normal unsigned APK) - name: Artifact (Normal unsigned APK)
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: love-android.apk name: love-android.apk
path: app/build/outputs/apk/normalRecord/release/app-normal-record-release-unsigned.apk path: app/build/outputs/apk/normalRecord/release/app-normal-record-release-unsigned.apk
- name: Artifact (Normal AAB w/o recording) - name: Artifact (Normal AAB w/o recording)
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: love-android-ps.aab name: love-android-ps.aab
path: app/build/outputs/bundle/normalNoRecordRelease/app-normal-noRecord-release.aab path: app/build/outputs/bundle/normalNoRecordRelease/app-normal-noRecord-release.aab
- name: Artifact (Embed AAB) - name: Artifact (Embed AAB)
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: love-android-embed-record.aab name: love-android-embed-record.aab
path: app/build/outputs/bundle/embedRecordRelease/app-embed-record-release.aab path: app/build/outputs/bundle/embedRecordRelease/app-embed-record-release.aab
- name: Artifact (Embed AAB w/o recording) - name: Artifact (Embed AAB w/o recording)
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: love-android-embed.aab name: love-android-embed.aab
@@ -50,5 +61,5 @@ jobs:
- name: Artifact (Debug symbols) - name: Artifact (Debug symbols)
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: love-android-unstripped-debugsyms name: love-android-unstripped-debugsyms-${{ matrix.build_type }}
path: love/build/intermediates/library_jni path: love/build/intermediates/library_jni