-
Notifications
You must be signed in to change notification settings - Fork 641
200 lines (171 loc) · 6.34 KB
/
onPush.yml
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
name: On Push
on:
workflow_dispatch:
inputs:
beta:
description: 'true if this is a beta release'
required: false
default: 'false'
push:
branches:
- master
env:
SUPPLY_UPLOAD_MAX_RETRIES: 5
jobs:
app_build:
name: Github, Firebase, and Sentry Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/create-release-number
name: Create Release Number
id: rel_number
- uses: ./.github/actions/inflate-secrets
name: Inflate Secrets
with:
keystore: ${{ secrets.ORIGINAL_KEYSTORE_FILE }}
google-services: ${{ secrets.GOOGLESERVICES }}
firebase-creds: ${{ secrets.FIREBASECREDS }}
playstore-creds: ${{ secrets.PLAYSTORECREDS }}
- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/download-translations
name: Download Translations
with:
lokalise-project: ${{ secrets.LOKALISE_PROJECT }}
lokalise-token: ${{ secrets.LOKALISE_TOKEN }}
- name: Build Release
env:
KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }}
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: |
./gradlew :common:assemble
./gradlew :app:assembleRelease
./gradlew :wear:assembleRelease
./gradlew :automotive:assembleRelease
- name: Archive Build
uses: actions/upload-artifact@v4
with:
name: release-apks
path: ./**/*.apk
- name: Create Version File
if: github.event.inputs.beta == 'true'
shell: bash
env:
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: |
echo $VERSION_CODE > ./app/build/outputs/version_code.txt
- name: Create Github Pre-Release
if: github.event.inputs.beta == 'true'
uses: softprops/[email protected]
with:
tag_name: ${{ steps.rel_number.outputs.version }}
body_path: ./app/build/outputs/changelogGithub
draft: false
prerelease: true
files: |
./app/build/outputs/apk/full/release/app-full-release.apk
./app/build/outputs/apk/minimal/release/app-minimal-release.apk
./app/build/outputs/version_code.txt
./wear/build/outputs/apk/release/wear-release.apk
./automotive/build/outputs/apk/full/release/automotive-full-release.apk
./automotive/build/outputs/apk/minimal/release/automotive-minimal-release.apk
- name: Deploy to Firebase
env:
KEYSTORE_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_FILE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS }}
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.ORIGINAL_KEYSTORE_ALIAS_PASSWORD }}
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: ./gradlew appDistributionUploadFullRelease
- name: Prepare Amazon Listing
if: github.event.inputs.beta == 'true'
run: bundle exec fastlane prep_amazon
env:
AMAZON_APPSTORE_CLIENT_ID: ${{ secrets.AMAZON_APPSTORE_CLIENT_ID }}
AMAZON_APPSTORE_CLIENT_SECRET: ${{ secrets.AMAZON_APPSTORE_CLIENT_SECRET }}
AMAZON_APPSTORE_APP_ID: ${{ secrets.AMAZON_APPSTORE_APP_ID }}
- name: Print `git status`
run: git status
play_publish:
name: Play Publish
runs-on: ubuntu-latest
concurrency:
group: playstore_deploy
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'temurin'
java-version: '17'
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.2'
bundler-cache: true
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- uses: ./.github/actions/create-release-number
name: Create Release Number
id: rel_number
- uses: ./.github/actions/inflate-secrets
name: Inflate Secrets
with:
keystore: ${{ secrets.UPLOAD_KEYSTORE_FILE }}
google-services: ${{ secrets.GOOGLESERVICES }}
firebase-creds: ${{ secrets.FIREBASECREDS }}
playstore-creds: ${{ secrets.PLAYSTORECREDS }}
- uses: ./.github/actions/create-release-notes
name: Create Release Notes
with:
tag-name: ${{ steps.rel_number.outputs.version }}
gh-token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/download-translations
name: Download Translations
with:
lokalise-project: ${{ secrets.LOKALISE_PROJECT }}
lokalise-token: ${{ secrets.LOKALISE_TOKEN }}
- name: Build Release
env:
KEYSTORE_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_FILE_PASSWORD }}
KEYSTORE_ALIAS: ${{ secrets.UPLOAD_KEYSTORE_ALIAS }}
KEYSTORE_ALIAS_PASSWORD: ${{ secrets.UPLOAD_KEYSTORE_ALIAS_PASSWORD }}
VERSION_CODE: ${{ steps.rel_number.outputs.version-code }}
run: |
./gradlew :common:assemble
./gradlew :app:bundleFullRelease
./gradlew :wear:bundleRelease
./gradlew :automotive:bundleFullRelease
- name: Archive Build
uses: actions/upload-artifact@v4
with:
name: release-aabs
path: ./**/*.aab
- name: Deploy to Playstore Internal
run: bundle exec fastlane deploy_internal
- name: Promote Internal to Beta
if: github.event.inputs.beta == 'true'
run: bundle exec fastlane promote_to_beta