Repository navigation
Expand file tree
/
Copy pathbuild-fcash2-upload-android.yml
More file actions
236 lines (202 loc) · 7.89 KB
/
Copy pathbuild-fcash2-upload-android.yml
File metadata and controls
236 lines (202 loc) · 7.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
name: Flipcash2 Build and Deploy
env:
# The name of the main module repository
main_project_module: apps:flipcash:app
# The name of the Play Store
playstore_name: Flipcash
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
track:
description: 'Define PlayStore track name'
required: true
default: 'internal'
type: choice
options:
- internal
- alpha
- beta
- production
release_status:
description: 'Status of the release'
required: true
type: choice
default: 'completed'
options:
- completed
- draft
- inProgress
- halted
jobs:
test:
runs-on: ubuntu-24.04 # ruby/setup-ruby has no Ruby 2.7 build for ubuntu-26.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Java env
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'corretto'
cache: 'gradle'
- name: Gradle build cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/build-cache-1
.gradle/configuration-cache
key: gradle-build-cache-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
restore-keys: |
gradle-build-cache-
- name: Setup Ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
- name: Decode Google Services JSON file
uses: timheuer/base64-to-file@v1
with:
fileName: google-services.json
fileDir: ./apps/flipcash/app/src
encodedString: ${{ secrets.FLIPCASH2_GOOGLE_SERVICES }}
- name: Setup BugSnag API Key
run: echo BUGSNAG_API_KEY=\"${{ secrets.FLIPCASH_BUGSNAG_API_KEY }}\" > ./local.properties
- name: Setup Google Cloud Project Number
run: echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties
- name: Setup Mixpanel API Key
run: echo MIXPANEL_API_KEY=\"${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}\" >> ./local.properties
- name: Setup Coinbase OnRamp API Key
run: echo COINBASE_ONRAMP_API_KEY=${{ secrets.COINBASE_ONRAMP_API_KEY }} >> ./local.properties
- name: Run tests
run: bundle exec fastlane android flipcash_tests
env:
SKIP_COVERAGE: "true"
build-release:
runs-on: ubuntu-24.04 # ruby/setup-ruby has no Ruby 2.7 build for ubuntu-26.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Java env
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'corretto'
cache: 'gradle'
- name: Gradle build cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches/build-cache-1
.gradle/configuration-cache
key: gradle-build-cache-${{ hashFiles('**/*.gradle.kts', 'gradle.properties') }}
restore-keys: |
gradle-build-cache-
- name: Setup Ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
- name: Decode Google Services JSON file
uses: timheuer/base64-to-file@v1
with:
fileName: google-services.json
fileDir: ./apps/flipcash/app/src
encodedString: ${{ secrets.FLIPCASH2_GOOGLE_SERVICES }}
- name: Decode Upload Key Store file
uses: timheuer/base64-to-file@v1
id: signing_key
with:
fileName: key
fileDir: ./key
encodedString: ${{ secrets.UPLOAD_KEY_STORE }}
- name: Setup BugSnag API Key
run: echo BUGSNAG_API_KEY=\"${{ secrets.FLIPCASH_BUGSNAG_API_KEY }}\" > ./local.properties
- name: Setup Google Cloud Project Number
run: echo GOOGLE_CLOUD_PROJECT_NUMBER=${{ secrets.GOOGLE_CLOUD_PROJECT_NUMBER }} >> ./local.properties
- name: Setup Mixpanel API Key
run: echo MIXPANEL_API_KEY=\"${{ secrets.FLIPCASH_MIXPANEL_API_KEY }}\" >> ./local.properties
- name: Setup Coinbase OnRamp API Key
run: echo COINBASE_ONRAMP_API_KEY=${{ secrets.COINBASE_ONRAMP_API_KEY }} >> ./local.properties
- name: Build release
run: bundle exec fastlane android build_flipcash
env:
# base64-to-file reports a workspace-relative path, and AGP resolves
# android.injected.signing.store.file against the Gradle daemon's working
# directory, not the project — so pass it absolute.
STORE_FILE: ${{ github.workspace }}/${{ steps.signing_key.outputs.filePath }}
STORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
KEY_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: release-artifacts
path: |
apps/flipcash/app/build/outputs/bundle/release
apps/flipcash/app/build/outputs/apk/release
apps/flipcash/app/build/outputs/mapping/release/mapping.txt
deploy:
needs: [test, build-release]
runs-on: ubuntu-24.04 # ruby/setup-ruby has no Ruby 2.7 build for ubuntu-26.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
persist-credentials: false
- name: Setup Ruby env
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7.2
bundler-cache: true
- name: Decode Service Account Key JSON file
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: serviceAccount.json
encodedString: ${{ secrets.FLIPCASH_SERVICE_ACCOUNT_KEY_JSON }}
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: release-artifacts
path: apps/flipcash/app/build/outputs
- name: Upload to Play Store
run: bundle exec fastlane android upload_flipcash
env:
SERVICE_ACCOUNT_KEY_JSON: ${{ steps.service_account_json_file.outputs.filePath }}
PACKAGE_NAME: com.flipcash.app.android
PLAYSTORE_TRACK: ${{ github.event.inputs.track }}
RELEASE_STATUS: ${{ github.event.inputs.release_status }}
AAB_PATH: apps/flipcash/app/build/outputs/bundle/release/app-release.aab
MAPPING_PATH: apps/flipcash/app/build/outputs/mapping/release/mapping.txt
- name: Update release manifest
id: manifest
env:
SERVICE_ACCOUNT_KEY_JSON: ${{ steps.service_account_json_file.outputs.filePath }}
TRACKS: ${{ github.event.inputs.track }}
run: bash scripts/update-release-manifest.sh
- name: Commit & push manifest
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .well-known/release-manifest.json
git diff --cached --quiet && echo "No changes to commit" && exit 0
git commit -m "build: update release manifest"
git clean -fd
git checkout -- .
git pull --rebase https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git code/cash
git push https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git HEAD:code/cash
- name: Upload build artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: assets
path: |
${{ github.workspace }}/apps/flipcash/app/build/outputs/bundle/release
${{ github.workspace }}/apps/flipcash/app/build/outputs/apk/release