Skip to content

Commit f20952e

Browse files
committed
mobile: build a signed android app
- generate signed APK for PRs - generate signed AAB for PRs targeting release branches - updates status-jenkins-lib to v1.9.29 which provides keystore and credentials for signing - added make mobile-bundle target which generates AAB - rename bundle id app.status.mobile - nuke FOREGROUND_SERVICE permission - automatically generate versionCode based on minutes since epoch - nuke unused mobile/android/qt5 dir - fix path to SecureAndroidAuthentication.java - bump nim to 2.2.4
1 parent 60f43e9 commit f20952e

File tree

85 files changed

+235
-204
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+235
-204
lines changed

Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,14 @@ mobile-run: deps-common
903903

904904
mobile-build: USE_SYSTEM_NIM=1
905905
mobile-build: | deps-common
906-
echo -e "\033[92mBuilding:\033[39m mobile app"
907-
$(MAKE) -C mobile
906+
echo -e "\033[92mBuilding:\033[39m mobile app ($(or $(PACKAGE_TYPE),default))"
907+
ifeq ($(PACKAGE_TYPE),aab)
908+
$(MAKE) -C mobile aab
909+
else ifeq ($(PACKAGE_TYPE),apk)
910+
$(MAKE) -C mobile apk
911+
else
912+
$(MAKE) -C mobile all
913+
endif
908914

909915
mobile-clean:
910916
echo -e "\033[92mCleaning:\033[39m mobile app"

ci/Jenkinsfile.android

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].24'
2+
library '[email protected].29'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()
66
def isNightlyBuild = utils.isNightlyBuild()
7+
def isReleaseBranch = (env.CHANGE_BRANCH ?: env.BRANCH_NAME)?.startsWith('release')
78

89
pipeline {
910
agent {
1011
/* Image with Ubuntu 22.04, QT 6.9.2, Android SDK/NDK, Go, and Nim */
1112
docker {
1213
label 'linuxcontainer'
13-
image 'harbor.status.im/status-im/status-desktop-build:1.0.5-qt6.9.2-android'
14-
alwaysPull true
14+
image 'harbor.status.im/status-im/status-desktop-build:1.0.6-qt6.9.2-android'
15+
alwaysPull true
1516
args '--entrypoint="" ' +
1617
'--volume=/nix:/nix ' +
1718
'--volume=/etc/nix:/etc/nix '
@@ -56,12 +57,13 @@ pipeline {
5657
VERSION = sh(script: "./scripts/version.sh", returnStdout: true).trim()
5758
/* Control output the filename */
5859
APP_TYPE = "${utils.getAppType()}"
59-
STATUS_APK_ARTIFACT = "pkg/${utils.pkgFilename(ext: 'apk', arch: 'arm64', version: env.VERSION, type: env.APP_TYPE)}"
6060
PLATFORM = "android/arm64"
6161
QT_VERSION = "6.9.2"
6262
QT_ANDROID_PATH = "/opt/qt/${env.QT_VERSION}/android_arm64_v8a"
6363
QMAKE = "/opt/qt/${env.QT_VERSION}/android_arm64_v8a/bin/qmake"
64-
STATUS_APK = "${WORKSPACE}/mobile/bin/android/qt6/Status.apk"
64+
PACKAGE_TYPE = "${isReleaseBranch ? 'aab' : 'apk'}"
65+
STATUS_ARTIFACT = "pkg/${utils.pkgFilename(ext: env.PACKAGE_TYPE, arch: 'arm64', version: env.VERSION, type: env.APP_TYPE)}"
66+
STATUS_BINARY = "${WORKSPACE}/mobile/bin/android/qt6/Status.${env.PACKAGE_TYPE}"
6567
}
6668

6769
stages {
@@ -78,19 +80,19 @@ pipeline {
7880
}
7981
}
8082

81-
stage('Build Android APK') {
83+
stage('Build Android') {
8284
steps {
8385
script {
84-
linux.bundle(target='mobile-build', verbose=params.VERBOSE)
86+
app.buildSignedAndroid(target='mobile-build PACKAGE_TYPE=' + env.PACKAGE_TYPE, verbose=params.VERBOSE)
8587
}
8688
}
8789
}
8890

89-
stage('Package APK') {
90-
steps {
91+
stage('Package') {
92+
steps {
9193
sh 'mkdir -p pkg'
92-
sh "cp ${env.STATUS_APK} ${env.STATUS_APK_ARTIFACT}"
93-
sh "ls -la ${env.STATUS_APK_ARTIFACT}"
94+
sh "cp ${env.STATUS_BINARY} ${env.STATUS_ARTIFACT}"
95+
sh "ls -la ${env.STATUS_ARTIFACT}"
9496
}
9597
}
9698

@@ -99,14 +101,16 @@ pipeline {
99101
stage('Upload') {
100102
steps {
101103
script {
102-
env.PKG_URL = s5cmd.upload(env.STATUS_APK_ARTIFACT)
103-
jenkins.setBuildDesc(APK: env.PKG_URL)
104+
env.PKG_URL = s5cmd.upload(env.STATUS_ARTIFACT)
105+
jenkins.setBuildDesc([(env.PACKAGE_TYPE.toUpperCase()): env.PKG_URL])
104106
}
105107
}
106108
}
107109
stage('Archive') {
108110
steps {
109-
archiveArtifacts env.STATUS_APK_ARTIFACT
111+
script {
112+
archiveArtifacts env.STATUS_ARTIFACT
113+
}
110114
}
111115
}
112116
}

ci/Jenkinsfile.combined

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env groovy
22

3-
library '[email protected].27'
3+
library '[email protected].29'
44

55
/* Object to store public URLs for description. */
66
urls = [:]

ci/Jenkinsfile.ios

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].24'
2+
library '[email protected].29'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()

ci/Jenkinsfile.linux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].27'
2+
library '[email protected].29'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()

ci/Jenkinsfile.linux-nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env groovy
22

3-
library '[email protected].27'
3+
library '[email protected].29'
44

55
/* Options section can't access functions in objects. */
66
def isPRBuild = utils.isPRBuild()

ci/Jenkinsfile.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].27'
2+
library '[email protected].29'
33

44
/* Options section can't access functions in objects. */
55
def isPRBuild = utils.isPRBuild()

ci/Jenkinsfile.qt-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].24'
2+
library '[email protected].29'
33

44
pipeline {
55
agent {

ci/Jenkinsfile.tests-e2e

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].16'
2+
library '[email protected].29'
33

44
pipeline {
55
agent {

ci/Jenkinsfile.tests-e2e.windows

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env groovy
2-
library '[email protected].28'
2+
library '[email protected].29'
33

44
pipeline {
55

0 commit comments

Comments
 (0)