9999 key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }}
100100 restore-keys : gradle-
101101
102+ - name : Upload Setup Artifacts
103+ uses : actions/upload-artifact@v4
104+ with :
105+ name : setup-files
106+ path : |
107+ ${{ steps.google_services_json_file.outputs.filePath }}
108+ ${{ steps.service_account_json_file.outputs.filePath }}
109+ ${{ steps.signing_key.outputs.filePath }}
110+ ./apps/flipcash/app/key/key
111+ ./local.properties
112+ if-no-files-found : error
113+
102114 tests :
103115 needs : setup
104116 runs-on : ubuntu-latest
@@ -107,74 +119,96 @@ jobs:
107119 with :
108120 fetch-depth : 0
109121
122+ - name : Setup Ruby env
123+ uses : ruby/setup-ruby@v1
124+ with :
125+ ruby-version : 2.7.2
126+ bundler-cache : true
127+
110128 - name : Restore Gradle Cache
111129 uses : actions/cache/restore@v3
112130 with :
113131 path : ~/.gradle/caches
114132 key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }}
115133 restore-keys : gradle-
116134
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
135+ - name : Download Setup Artifacts
136+ uses : actions/download-artifact@v4
137+ with :
138+ name : setup-files
139+ path : .
129140
130141 - name : Run tests
131142 run : bundle exec fastlane android flipcash_tests
132143
133- deploy :
144+ build :
134145 needs : setup
135146 runs-on : ubuntu-latest
136147 steps :
137148 - uses : actions/checkout@v4
138149 with :
139150 fetch-depth : 0
140151
152+ - name : Setup Ruby env
153+ uses : ruby/setup-ruby@v1
154+ with :
155+ ruby-version : 2.7.2
156+ bundler-cache : true
157+
141158 - name : Restore Gradle Cache
142159 uses : actions/cache/restore@v3
143160 with :
144161 path : ~/.gradle/caches
145162 key : gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties') }}
146163 restore-keys : gradle-
147164
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
165+ - name : Download Setup Artifacts
166+ uses : actions/download-artifact@v4
167+ with :
168+ name : setup-files
169+ path : .
170+
171+ - name : Build Android release
172+ run : bundle exec fastlane android build_flipcash
163173 env :
164174 STORE_FILE : ${{ needs.setup.outputs.signing_key }}
165175 STORE_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
166176 KEY_ALIAS : ${{ secrets.KEY_ALIAS }}
167177 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 }}
172178
173- - name : Upload build artifacts
179+ - name : Upload Build Artifacts
174180 uses : actions/upload-artifact@v4
175- if : always()
176181 with :
177- name : assets
182+ name : build- assets
178183 path : |
179- ${{ github.workspace }}/apps/flipcash/app/build/outputs/bundle/release
180- ${{ github.workspace }}/apps/flipcash/app/build/outputs/apk/release
184+ ${{ github.workspace }}/artifacts/*.aab
185+ ${{ github.workspace }}/artifacts/*.txt
186+ if-no-files-found : error
187+
188+ deploy :
189+ needs : [tests, build]
190+ runs-on : ubuntu-latest
191+ steps :
192+ - uses : actions/checkout@v4
193+ with :
194+ fetch-depth : 0
195+
196+ - name : Setup Ruby env
197+ uses : ruby/setup-ruby@v1
198+ with :
199+ ruby-version : 2.7.2
200+ bundler-cache : true
201+
202+ - name : Download Build Artifacts
203+ uses : actions/download-artifact@v4
204+ with :
205+ name : build-assets
206+ path : artifacts/
207+
208+ - name : Deploy to Play Store
209+ run : bundle exec fastlane android upload_to_play_store
210+ env :
211+ SERVICE_ACCOUNT_KEY_JSON : ${{ needs.setup.outputs.service_account_json }}
212+ PACKAGE_NAME : com.flipcash.android.app
213+ PLAYSTORE_TRACK : ${{ github.event.inputs.track }}
214+ RELEASE_STATUS : ${{ github.event.inputs.release_status }}
0 commit comments