status-go/_assets/ci/Jenkinsfile.android

86 lines
2.3 KiB
Plaintext
Raw Normal View History

library 'status-jenkins-lib@v1.3.3'
2019-02-01 17:02:52 +00:00
pipeline {
2022-05-11 10:24:30 +00:00
agent { label 'linux && x86_64 && go-1.18' }
2019-02-01 17:02:52 +00:00
parameters {
string(
name: 'BRANCH',
defaultValue: 'develop',
description: 'Name of branch to build.'
)
booleanParam(
name: 'RELEASE',
defaultValue: false,
description: 'Enable to create build for release.',
)
}
2019-02-01 17:02:52 +00:00
options {
timestamps()
disableConcurrentBuilds()
2019-02-01 17:02:52 +00:00
/* Go requires a certain directory structure */
checkoutToSubdirectory('src/github.com/status-im/status-go')
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '5',
2019-02-01 17:02:52 +00:00
daysToKeepStr: '30',
))
}
environment {
/* fix for gomobile complaining about missing packages */
CGO_ENABLED = "1"
/* Other stuff */
TARGET = 'android'
REPO = "${env.WORKSPACE}/src/github.com/status-im/status-go"
GOPATH = "${env.WORKSPACE}"
PATH = "/usr/local/go/bin:${env.PATH}:${env.GOPATH}/bin"
/* Android SDK */
2019-02-01 17:02:52 +00:00
ANDROID_HOME = '/usr/lib/android-sdk'
ANDROID_SDK_ROOT = '/usr/lib/android-sdk'
/* gomobile requires a specific NDK version */
ANDROID_NDK = "${env.NDK_GOMOBILE}"
ANDROID_NDK_HOME = "${env.NDK_GOMOBILE}"
2019-02-01 17:02:52 +00:00
}
stages {
stage('Prep') { steps { dir(env.REPO) { script {
env.ARTIFACT = "${env.WORKSPACE}/" + utils.pkgFilename(
name: "status-go",
type: "android",
ext: "aar"
)
println("Output: ${env.ARTIFACT}")
} } } }
2019-02-01 17:02:52 +00:00
stage('Setup') { steps { dir(env.REPO) {
sh 'make setup-build install-modvendor'
2019-02-01 17:02:52 +00:00
} } }
stage('Vendoring check') { steps { dir(env.REPO) {
/* fail build if vendoring hasn't been done */
sh 'make vendor'
sh 'git diff --exit-code --no-color --stat vendor/'
} } }
stage('Compile') { steps { dir(env.REPO) {
2019-02-01 17:02:52 +00:00
sh 'make statusgo-android'
sh "cp build/bin/statusgo.aar ${env.ARTIFACT}"
2019-02-01 17:02:52 +00:00
} } }
stage('Archive') { steps {
archiveArtifacts(env.ARTIFACT.minus("${env.WORKSPACE}/"))
2019-02-01 17:02:52 +00:00
} }
stage('Upload') { steps { script {
env.PKG_URL = s3.uploadArtifact(env.ARTIFACT)
2019-02-01 17:02:52 +00:00
} } }
} // stages
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
always { dir(env.REPO) { sh 'make clean' } }
} // post
2019-02-01 17:02:52 +00:00
} // pipeline