-
Notifications
You must be signed in to change notification settings - Fork 131
142 lines (119 loc) · 5.09 KB
/
mobile-deploy-android.yml
File metadata and controls
142 lines (119 loc) · 5.09 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
name: Deploy Android to Google Play
on:
release:
types:
[prereleased, released]
jobs:
build-android:
# needs: detox-android
runs-on: ${{ matrix.os }}
if: |
startsWith(github.ref, 'refs/tags/@quiet/mobile')
strategy:
matrix:
os: [ubuntu-latest-m]
steps:
- name: "Print OS"
run: echo ${{ matrix.os }}
- uses: actions/checkout@v5
with:
submodules: 'recursive'
- name: Extract version
id: extract_version
uses: Saionaro/extract-package-version@fdb5b74adc1278ddb777dfed4c988b9d098bb48d # v1.2.1
with:
path: packages/mobile
- name: "Set up JDK"
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: "Set up NDK"
uses: nttld/setup-ndk@ed92fe6cadad69be94a966a7ee3271275e62f779 # v1.6.0
id: setup-ndk
with:
ndk-version: r28c
add-to-path: false
- name: "Install Bundletool"
run: |
wget https://github.com/google/bundletool/releases/download/1.15.6/bundletool-all-1.15.6.jar -O /usr/local/bin/bundletool.jar
- name: "Setup environment"
uses: ./.github/actions/setup-env
with:
bootstrap-packages: "@quiet/eslint-config,@quiet/logger,@quiet/common,@quiet/types,@quiet/state-manager,@quiet/backend,@quiet/identity,@quiet/mobile,backend-bundle,helia,@quiet/node-common"
- name: "Create gradle configuration directory"
run: mkdir -p $HOME/.gradle
- name: "Prepare ndk configuration"
run: |
printf "\
NDK_PATH=${{ steps.setup-ndk.outputs.ndk-path }}\n\
" > $HOME/.gradle/gradle.properties
- name: "Prepare signing configuration"
run: |
printf "\
STORE_FILE=quietmobile.keystore\n\
STORE_PASSWORD=${{ SECRETS.GOOGLE_KEYSTORE_PASSWORD }}\n\
KEY_ALIAS=${{ SECRETS.GOOGLE_KEYSTORE_ALIAS }}\n\
KEY_PASSWORD=${{ SECRETS.GOOGLE_KEYSTORE_PASSWORD }}\
" >> $HOME/.gradle/gradle.properties
- name: "Decode keystore"
run: echo ${{ SECRETS.GOOGLE_KEYSTORE }} | base64 --decode > ./packages/mobile/android/app/quietmobile.keystore
- name: "Build .aab"
run: cd ./packages/mobile/android && ENVFILE=../.env.production ./gradlew bundleStandardRelease
- name: "Upload .abb to artifacts"
continue-on-error: true
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: app-standard-release.aab
path: ./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.aab
retention-days: 5
- name: "Build .apks"
run: |
java -jar /usr/local/bin/bundletool.jar build-apks \
--bundle=./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.aab \
--output=./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.apks \
--ks=./packages/mobile/android/app/quietmobile.keystore \
--ks-pass=pass:${{ SECRETS.GOOGLE_KEYSTORE_PASSWORD }} \
--ks-key-alias=${{ SECRETS.GOOGLE_KEYSTORE_ALIAS }}
- name: "Upload .apks to artifacts"
continue-on-error: true
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: app-standard-release.apks
path: ./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.apks
- name: "Get release"
id: get_release
uses: bruceadams/get-release@v1.2.3
env:
GITHUB_TOKEN: ${{ github.token }}
- name: "Upload release assets"
uses: actions/upload-release-asset@v1.0.2
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.apks
asset_name: app-standard-release.apks
asset_content_type: application/.apks
- name: "Configure Google Play upload"
run: |
mkdir -p distribution/whatsnew
git log -1 --pretty=format:%s > distribution/whatsnew/whatsnew-pl-PL
echo ${{ SECRETS.SERVICE_ACCOUNT_JSON }} | base64 --decode > google-play.json
- name: "Upload to Google Play"
uses: r0adkll/upload-google-play@v1.1.2
with:
serviceAccountJson: google-play.json
packageName: com.quietmobile
releaseFiles: ./packages/mobile/android/app/build/outputs/bundle/standardRelease/app-standard-release.aab
status: completed
track: internal
whatsNewDirectory: distribution/whatsnew
- name: Send Release Notificaton
uses: ./.github/actions/release-notifier
if: always()
with:
os-name: Android
version: ${{ steps.extract_version.outputs.version }}
status: ${{ job.status }}
slack_oauth_token: ${{ secrets.SLACK_BOT_OAUTH_TOKEN }}