status-go/_assets/ci/Jenkinsfile.android
Jakub Sokołowski 9dd80e7f1e
ci: use Nix shell to provide Android SDK for builds
Installing the SDK via Ansible is prone to error and not exactly
reproduceable. This way we can also track the exact tooling version as
used in Status Mobile app:
https://github.com/status-im/status-mobile/blob/develop/nix/pkgs.nix

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-12-05 15:48:27 +01:00

70 lines
1.5 KiB
Plaintext

library 'status-jenkins-lib@v1.6.4'
pipeline {
agent { label 'linux && x86_64' }
parameters {
string(
name: 'BRANCH',
defaultValue: 'develop',
description: 'Name of branch to build.'
)
booleanParam(
name: 'RELEASE',
defaultValue: false,
description: 'Enable to create build for release.',
)
}
options {
timestamps()
disableConcurrentBuilds()
/* manage how many builds we keep */
buildDiscarder(logRotator(
numToKeepStr: '5',
daysToKeepStr: '30',
))
}
environment {
TARGET = 'android'
GOPATH = "${WORKSPACE_TMP}/go"
PATH = "${PATH}:${GOPATH}/bin"
REPO_SRC = "${GOPATH}/src/github.com/status-im/status-go"
ARTIFACT = utils.pkgFilename(name: "status-go", type: "android", ext: "aar", version: null)
}
stages {
stage('Setup') {
steps { /* Go needs to find status-go in GOPATH. */
sh "mkdir -p \$(dirname ${REPO_SRC})"
sh "ln -s ${WORKSPACE} ${REPO_SRC}"
}
}
stage('Compile') {
steps { script {
nix.shell('make statusgo-android', pure: false)
sh "mv build/bin/statusgo.aar ${ARTIFACT}"
} }
}
stage('Archive') {
steps { script {
archiveArtifacts(ARTIFACT)
} }
}
stage('Upload') {
steps { script {
env.PKG_URL = s3.uploadArtifact(ARTIFACT)
} }
}
} // stages
post {
success { script { github.notifyPR(true) } }
failure { script { github.notifyPR(false) } }
cleanup { sh 'make clean' }
} // post
} // pipeline