mirror of
https://github.com/status-im/status-app.git
synced 2026-08-27 15:11:20 +00:00
123 lines
3.2 KiB
Groovy
123 lines
3.2 KiB
Groovy
#!/usr/bin/env groovy
|
|
library 'status-jenkins-lib@v1.9.24'
|
|
|
|
/* Options section can't access functions in objects. */
|
|
def isPRBuild = utils.isPRBuild()
|
|
def isNightlyBuild = utils.isNightlyBuild()
|
|
|
|
pipeline {
|
|
agent {
|
|
/* Image with Ubuntu 22.04, QT 6.9.2, Android SDK/NDK, Go, and Nim */
|
|
docker {
|
|
label 'linuxcontainer'
|
|
image 'harbor.status.im/status-im/status-desktop-build:1.0.5-qt6.9.2-android'
|
|
alwaysPull true
|
|
args '--entrypoint="" ' +
|
|
'--volume=/nix:/nix ' +
|
|
'--volume=/etc/nix:/etc/nix '
|
|
}
|
|
}
|
|
|
|
parameters {
|
|
booleanParam(
|
|
name: 'RELEASE',
|
|
description: 'Decides whether release credentials are used.',
|
|
defaultValue: params.RELEASE ?: false
|
|
)
|
|
choice(
|
|
name: 'VERBOSE',
|
|
description: 'Level of verbosity based on nimbus-build-system setup.',
|
|
choices: ['0','1','2','3']
|
|
)
|
|
}
|
|
|
|
options {
|
|
timestamps()
|
|
/* Prevent Jenkins jobs from running forever */
|
|
timeout(time: 45, unit: 'MINUTES')
|
|
/* manage how many builds we keep */
|
|
buildDiscarder(logRotator(
|
|
numToKeepStr: '10',
|
|
daysToKeepStr: '30',
|
|
artifactNumToKeepStr: '3',
|
|
))
|
|
/* Allows combined build to copy */
|
|
copyArtifactPermission('/status-desktop/*')
|
|
/* Abort old PR builds. */
|
|
disableConcurrentBuilds(abortPrevious: isPRBuild)
|
|
disableRestartFromStage()
|
|
}
|
|
|
|
environment {
|
|
GOCACHE = "${env.WORKSPACE_TMP}/go-cache"
|
|
GOMODCACHE = "${env.WORKSPACE_TMP}/go-mod-cache"
|
|
GOTMPDIR = "${env.WORKSPACE_TMP}"
|
|
/* sets App Version in Settings */
|
|
VERSION = sh(script: "./scripts/version.sh", returnStdout: true).trim()
|
|
/* Control output the filename */
|
|
APP_TYPE = "${utils.getAppType()}"
|
|
STATUS_APK_ARTIFACT = "pkg/${utils.pkgFilename(ext: 'apk', arch: 'arm64', version: env.VERSION, type: env.APP_TYPE)}"
|
|
PLATFORM = "android/arm64"
|
|
QT_VERSION = "6.9.2"
|
|
QT_ANDROID_PATH = "/opt/qt/${env.QT_VERSION}/android_arm64_v8a"
|
|
QMAKE = "/opt/qt/${env.QT_VERSION}/android_arm64_v8a/bin/qmake"
|
|
STATUS_APK = "${WORKSPACE}/mobile/bin/android/qt6/Status.apk"
|
|
}
|
|
|
|
stages {
|
|
|
|
stage('Cleanup Workspace') {
|
|
steps {
|
|
sh './scripts/clean-git.sh'
|
|
}
|
|
}
|
|
|
|
stage('Fetch submodules') {
|
|
steps {
|
|
sh 'git submodule update --init --recursive'
|
|
}
|
|
}
|
|
|
|
stage('Build Android APK') {
|
|
steps {
|
|
script {
|
|
linux.bundle(target='mobile-build', verbose=params.VERBOSE)
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Package APK') {
|
|
steps {
|
|
sh 'mkdir -p pkg'
|
|
sh "cp ${env.STATUS_APK} ${env.STATUS_APK_ARTIFACT}"
|
|
sh "ls -la ${env.STATUS_APK_ARTIFACT}"
|
|
}
|
|
}
|
|
|
|
stage('Parallel Upload') {
|
|
parallel {
|
|
stage('Upload') {
|
|
steps {
|
|
script {
|
|
env.PKG_URL = s5cmd.upload(env.STATUS_APK_ARTIFACT)
|
|
jenkins.setBuildDesc(APK: env.PKG_URL)
|
|
}
|
|
}
|
|
}
|
|
stage('Archive') {
|
|
steps {
|
|
archiveArtifacts env.STATUS_APK_ARTIFACT
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
post {
|
|
success { script { github.notifyPR(true) } }
|
|
failure { script { github.notifyPR(false) } }
|
|
cleanup { sh './scripts/clean-git.sh' }
|
|
}
|
|
}
|
|
|