44 main_project_module : apps:flipcash:app
55 playstore_name : Flipcash
66
7+ # Cancel in-progress workflow runs if a job fails
8+ concurrency :
9+ group : ${{ github.workflow }}-${{ github.event_name }}-${{ github.event.inputs.track }}-${{ github.event.inputs.release_status }}
10+ cancel-in-progress : true
11+
712on :
813 workflow_dispatch :
914 inputs :
@@ -95,10 +100,24 @@ jobs:
95100 - name : Cache Gradle
96101 uses : actions/cache@v3
97102 with :
98- path : ~/.gradle/caches
99- key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }}
103+ path : |
104+ ~/.gradle/caches
105+ ~/.gradle/wrapper
106+ key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle/wrapper/*') }}
100107 restore-keys : gradle-
101108
109+ - name : Upload Setup Artifacts
110+ uses : actions/upload-artifact@v4
111+ with :
112+ name : setup-files
113+ path : |
114+ ${{ steps.google_services_json_file.outputs.filePath }}
115+ ${{ steps.service_account_json_file.outputs.filePath }}
116+ ${{ steps.signing_key.outputs.filePath }}
117+ ./apps/flipcash/app/key/key
118+ ./local.properties
119+ if-no-files-found : error
120+
102121 tests :
103122 needs : setup
104123 runs-on : ubuntu-latest
@@ -107,74 +126,100 @@ jobs:
107126 with :
108127 fetch-depth : 0
109128
129+ - name : Setup Ruby env
130+ uses : ruby/setup-ruby@v1
131+ with :
132+ ruby-version : 2.7.2
133+ bundler-cache : true
134+
110135 - name : Restore Gradle Cache
111136 uses : actions/cache/restore@v3
112137 with :
113- path : ~/.gradle/caches
114- key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }}
138+ path : |
139+ ~/.gradle/caches
140+ ~/.gradle/wrapper
141+ key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle/wrapper/*') }}
115142 restore-keys : gradle-
116143
117- - name : Copy Setup Files
118- run : |
119- mkdir -p ./apps/flipcash/app/src
120- mkdir -p ./key
121- mkdir -p ./apps/flipcash/app/key
122- cp ${{ needs.setup.outputs.google_services_json }} ./apps/flipcash/app/src/google-services.json
123- cp ${{ needs.setup.outputs.service_account_json }} ./serviceAccount.json
124- cp ${{ needs.setup.outputs.signing_key }} ./key/key
125- cp ${{ needs.setup.outputs.signing_key }} ./apps/flipcash/app/key/key
126- echo BUGSNAG_API_KEY=\"${{ secrets.FLIPCASH_BUGSNAG_API_KEY }}\" > ./local.properties
127- echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties
128- echo MIXPANEL_API_KEY=\"${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}\" >> ./local.properties
144+ - name : Download Setup Artifacts
145+ uses : actions/download-artifact@v4
146+ with :
147+ name : setup-files
148+ path : code-android-app/
129149
130150 - name : Run tests
131151 run : bundle exec fastlane android flipcash_tests
132152
133- deploy :
153+ build :
134154 needs : setup
135155 runs-on : ubuntu-latest
136156 steps :
137157 - uses : actions/checkout@v4
138158 with :
139159 fetch-depth : 0
140160
161+ - name : Setup Ruby env
162+ uses : ruby/setup-ruby@v1
163+ with :
164+ ruby-version : 2.7.2
165+ bundler-cache : true
166+
141167 - name : Restore Gradle Cache
142168 uses : actions/cache/restore@v3
143169 with :
144- path : ~/.gradle/caches
145- key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }}
170+ path : |
171+ ~/.gradle/caches
172+ ~/.gradle/wrapper
173+ key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle/wrapper/*') }}
146174 restore-keys : gradle-
147175
148- - name : Copy Setup Files
149- run : |
150- mkdir -p ./apps/flipcash/app/src
151- mkdir -p ./key
152- mkdir -p ./apps/flipcash/app/key
153- cp ${{ needs.setup.outputs.google_services_json }} ./apps/flipcash/app/src/google-services.json
154- cp ${{ needs.setup.outputs.service_account_json }} ./serviceAccount.json
155- cp ${{ needs.setup.outputs.signing_key }} ./key/key
156- cp ${{ needs.setup.outputs.signing_key }} ./apps/flipcash/app/key/key
157- echo BUGSNAG_API_KEY=\"${{ secrets.FLIPCASH_BUGSNAG_API_KEY }}\" > ./local.properties
158- echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties
159- echo MIXPANEL_API_KEY=\"${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}\" >> ./local.properties
160-
161- - name : Build & deploy Android release
162- run : bundle exec fastlane android deploy_flipcash
176+ - name : Download Setup Artifacts
177+ uses : actions/download-artifact@v4
178+ with :
179+ name : setup-files
180+ path : code-android-app/
181+
182+ - name : Build Android release
183+ run : bundle exec fastlane android build_flipcash
163184 env :
164185 STORE_FILE : ${{ needs.setup.outputs.signing_key }}
165186 STORE_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
166187 KEY_ALIAS : ${{ secrets.KEY_ALIAS }}
167188 KEY_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
168- SERVICE_ACCOUNT_KEY_JSON : ${{ needs.setup.outputs.service_account_json }}
169- PACKAGE_NAME : com.flipcash.android.app
170- PLAYSTORE_TRACK : ${{ github.event.inputs.track }}
171- RELEASE_STATUS : ${{ github.event.inputs.release_status }}
172189
173- - name : Upload build artifacts
190+ - name : Upload Build Artifacts
174191 uses : actions/upload-artifact@v4
175- if : always()
176192 with :
177- name : assets
193+ name : build- assets
178194 path : |
179- ${{ github.workspace }}/apps/flipcash/app/build/outputs/bundle/release
180- ${{ github.workspace }}/apps/flipcash/app/build/outputs/apk/release
195+ ${{ github.workspace }}/artifacts/*.aab
196+ ${{ github.workspace }}/artifacts/*.txt
197+ if-no-files-found : error
198+
199+ deploy :
200+ needs : [tests, build]
201+ runs-on : ubuntu-latest
202+ steps :
203+ - uses : actions/checkout@v4
204+ with :
205+ fetch-depth : 0
206+
207+ - name : Setup Ruby env
208+ uses : ruby/setup-ruby@v1
209+ with :
210+ ruby-version : 2.7.2
211+ bundler-cache : true
212+
213+ - name : Download Build Artifacts
214+ uses : actions/download-artifact@v4
215+ with :
216+ name : build-assets
217+ path : artifacts/
218+
219+ - name : Deploy to Play Store
220+ run : bundle exec fastlane android deploy_to_play_store
221+ env :
222+ SERVICE_ACCOUNT_KEY_JSON : ./code-android-app/serviceAccount.json
223+ PACKAGE_NAME : com.flipcash.android.app
224+ PLAYSTORE_TRACK : ${{ github.event.inputs.track }}
225+ RELEASE_STATUS : ${{ github.event.inputs.release_status }}
0 commit comments