1919 - ' **.json'
2020 - ' fastlane/**'
2121 - ' .github/workflows/crowdin_contributors.yml'
22- workflow_dispatch : { }
22+ workflow_dispatch :
23+ inputs :
24+ build_type :
25+ description : ' Select Build Type'
26+ required : true
27+ default : ' Debug'
28+ type : choice
29+ options :
30+ - Debug
31+ - Release
2332
2433jobs :
2534 build_release_apk :
26- name : Build Debug APK
35+ name : Build APK
2736 runs-on : ubuntu-latest
2837 steps :
2938 - name : Cancel previous runs
3039 uses : styfle/cancel-workflow-action@0.12.1
3140 with :
3241 access_token : ${{ github.token }}
42+
3343 - name : Checkout
3444 uses : actions/checkout@v4
3545 with :
3646 submodules : ' recursive'
3747 fetch-depth : 0
48+
49+ - name : Determine Build Type Configuration
50+ run : |
51+ SELECTED_TYPE="${{ github.event.inputs.build_type }}"
52+ BUILD_TYPE="${SELECTED_TYPE:-Debug}"
53+ echo "BUILD_TYPE=$BUILD_TYPE" >> $GITHUB_ENV
54+ echo "BUILD_TYPE_LOWER=$(echo "$BUILD_TYPE" | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
55+
3856 - name : Set up JDK 17
3957 uses : actions/setup-java@v4
4058 with :
4159 java-version : ' 17'
4260 distribution : ' adopt'
61+
4362 - name : Change Gradle wrapper permissions
4463 run : chmod +x ./gradlew
64+
4565 - name : Restore cache
4666 uses : actions/cache@v4
4767 with :
@@ -51,12 +71,14 @@ jobs:
5171 key : ${{ runner.os }}-gradle-v2-${{ hashFiles('**/*.gradle*') }}
5272 restore-keys : |
5373 ${{ runner.os }}-gradle-
74+
5475 - name : Create local.properties
5576 run : |
5677 echo "signing.storeFile=signing/signing-key.jks" >> local.properties
5778 echo "signing.storePassword=123456" >> local.properties
5879 echo "signing.keyAlias=android-ide" >> local.properties
5980 echo "signing.keyPassword=123456" >> local.properties
81+
6082 - name : Debug signing setup
6183 run : |
6284 echo "=== Repository structure ==="
@@ -67,32 +89,37 @@ jobs:
6789 echo ""
6890 echo "=== SigningDirectory ==="
6991 ls -la core/app/signing/ || echo "core/app/signing directory not found"
70- - name : Assemble Debug APK
71- run : ./gradlew :core:app:assembleDebug
72- # run: ./gradlew :core:app:assembleRelease
73- - name : List APK files (debug)
74- run : ls -la core/app/build/outputs/apk/debug/
75- - name : Upload arm64-v8a Release APK
92+
93+ - name : Assemble APK
94+ run : ./gradlew assemble${{ env.BUILD_TYPE }}
95+
96+ - name : List APK files
97+ run : ls -la core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }}/ || echo "Directory not found"
98+
99+ - name : Upload arm64-v8a APK
76100 uses : actions/upload-artifact@v4
77101 with :
78- name : apk-arm64-v8a-debug
79- path : core/app/build/outputs/apk/debug /*arm64-v8a*.apk
102+ name : apk-arm64-v8a-${{ env.BUILD_TYPE_LOWER }}
103+ path : core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }} /*arm64-v8a*.apk
80104 if : always()
81- - name : Upload armeabi-v7a Release APK
105+
106+ - name : Upload armeabi-v7a APK
82107 uses : actions/upload-artifact@v4
83108 with :
84- name : apk-armeabi-v7a-release
85- path : core/app/build/outputs/apk/release /*armeabi-v7a*.apk
109+ name : apk-armeabi-v7a-${{ env.BUILD_TYPE_LOWER }}
110+ path : core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }} /*armeabi-v7a*.apk
86111 if : always()
87- - name : Upload x86_64 Release APK
112+
113+ - name : Upload x86_64 APK
88114 uses : actions/upload-artifact@v4
89115 with :
90- name : apk-x86_64-release
91- path : core/app/build/outputs/apk/release /*x86_64*.apk
116+ name : apk-x86_64-${{ env.BUILD_TYPE_LOWER }}
117+ path : core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }} /*x86_64*.apk
92118 if : always()
93- - name : Upload universal Release APK
119+
120+ - name : Upload universal APK
94121 uses : actions/upload-artifact@v4
95122 with :
96- name : apk-universal-release
97- path : core/app/build/outputs/apk/release /*universal*.apk
98- if : always()
123+ name : apk-universal-${{ env.BUILD_TYPE_LOWER }}
124+ path : core/app/build/outputs/apk/${{ env.BUILD_TYPE_LOWER }} /*universal*.apk
125+ if : always()
0 commit comments