-
Notifications
You must be signed in to change notification settings - Fork 16
177 lines (151 loc) · 7.36 KB
/
master.yaml
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
name: Master
on:
push:
branches: [ master ]
# Allows for running this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: Build
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
new_tag: ${{ steps.bump_version.outputs.new_tag }}
steps:
- name: Checkout the code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Bump version
id: bump_version
uses: oflynned/Android-Semantic-Release@c2a5e19a1239f4e1639f270ebd0aeb913438520d
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Write version to file for use in other workflows
run: |
echo ${{ steps.bump_version.outputs.new_tag }} > VERSION
- name: Create google-services.json from secrets
env:
GOOGLE_SERVICES_JSON: ${{ secrets.GOOGLE_SERVICES_JSON }}
run: echo $GOOGLE_SERVICES_JSON > app/google-services.json
- name: Set up JDK 17
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b
with:
java-version: '17'
distribution: 'corretto'
cache: gradle
- name: Clear gradle cache
run: |
mv ~/.gradle ~/.invalid || true
- name: Cache dependencies
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ env.CACHE_VERSION }}-${{ hashFiles('**/**.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties', '**/libs.versions.toml') }}
- name: Check Gradle wrapper
uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6
- name: Build the app
run: ./gradlew assembleRelease bundleRelease
- name: Upload VERSION
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: VERSION
path: VERSION
if-no-files-found: error
- name: Upload unsigned APK
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: bisq-release.apk
path: app/build/outputs/apk/release/bisq-release.apk
if-no-files-found: error
- name: Upload unsigned AAB
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: bisq-release.aab
path: app/build/outputs/bundle/release/bisq-release.aab
if-no-files-found: error
sign:
name: Sign
runs-on: ubuntu-latest
timeout-minutes: 10
needs: build
steps:
- name: Download unsigned APK
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: bisq-release.apk
path: app/build/outputs/apk/release
- name: Download unsigned AAB
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: bisq-release.aab
path: app/build/outputs/bundle/release
- name: Determine latest build-tools version
shell: bash
run: |
LATEST_BUILD_TOOLS_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "LATEST_BUILD_TOOLS_VERSION=$LATEST_BUILD_TOOLS_VERSION" >> $GITHUB_ENV
echo Latest build tools version is: $LATEST_BUILD_TOOLS_VERSION
- name: Sign APK
uses: r0adkll/sign-android-release@dbeba6b98a60b0fd540c02443c7f428cdedf0e7f
id: sign_apk
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.LATEST_BUILD_TOOLS_VERSION }}
- name: Sign AAB
uses: r0adkll/sign-android-release@dbeba6b98a60b0fd540c02443c7f428cdedf0e7f
id: sign_aab
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: ${{ env.LATEST_BUILD_TOOLS_VERSION }}
- name: Upload signed APK
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: bisq-release-signed.apk
path: ${{ steps.sign_apk.outputs.signedReleaseFile }}
- name: Upload signed AAB
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08
with:
name: bisq-release-signed.aab
path: ${{ steps.sign_aab.outputs.signedReleaseFile }}
upload_to_firebase:
name: Upload to Firebase
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [ build, sign ]
steps:
- name: Checkout the code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- name: Download signed APK
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: bisq-release-signed.apk
path: app/build/outputs/apk/release
- name: Download signed AAB
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: bisq-release-signed.aab
path: app/build/outputs/bundle/release
- name: Upload signed APK to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@a41b2f7ab3f7c2631b6a73fb2f660b517cef45a9
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
file: app/build/outputs/apk/release/bisq-release-signed.apk
- name: Upload signed AAB to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@a41b2f7ab3f7c2631b6a73fb2f660b517cef45a9
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
file: app/build/outputs/bundle/release/bisq-release.aab